summaryrefslogtreecommitdiff
path: root/Python/_warnings.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/_warnings.c')
-rw-r--r--Python/_warnings.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c
index da52e357c3..ef7f373bdd 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -320,6 +320,8 @@ warn_explicit(PyObject *category, PyObject *message,
}
if (rc == 1) {
text = PyObject_Str(message);
+ if (text == NULL)
+ goto cleanup;
category = (PyObject*)message->ob_type;
}
else {