Index: Python/_warnings.c =================================================================== --- Python/_warnings.c (revision 73839) +++ Python/_warnings.c (working copy) @@ -317,6 +317,8 @@ } if (rc == 1) { text = PyObject_Str(message); + if (text == NULL) + goto cleanup; category = (PyObject*)message->ob_type; } else {