summaryrefslogtreecommitdiff
path: root/Python/_warnings.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/_warnings.c')
-rw-r--r--Python/_warnings.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c
index 39f8033cd9..834ceb1845 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -491,8 +491,9 @@ show_warning(PyObject *filename, int lineno, PyObject *text,
PyOS_snprintf(lineno_str, sizeof(lineno_str), ":%d: ", lineno);
name = _PyObject_GetAttrId(category, &PyId___name__);
- if (name == NULL) /* XXX Can an object lack a '__name__' attribute? */
+ if (name == NULL) {
goto error;
+ }
f_stderr = _PySys_GetObjectId(&PyId_stderr);
if (f_stderr == NULL) {