Issue #6415: Fixed warnings.warn sagfault on bad formatted string.

This commit is contained in:
Hirokazu Yamamoto 2009-07-17 06:20:46 +00:00
parent 66da2635ff
commit e78e5d2e51
2 changed files with 15 additions and 0 deletions

View file

@ -317,6 +317,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 {