Patch #828384: Don't discard nested exception in AddObject.

This commit is contained in:
Martin v. Löwis 2003-10-24 20:05:32 +00:00
parent 7883dc8abb
commit f8d59d28e0
1 changed files with 3 additions and 2 deletions

View File

@ -520,8 +520,9 @@ PyModule_AddObject(PyObject *m, char *name, PyObject *o)
return -1;
}
if (!o) {
PyErr_SetString(PyExc_TypeError,
"PyModule_AddObject() needs non-NULL value");
if (!PyErr_Occurred())
PyErr_SetString(PyExc_TypeError,
"PyModule_AddObject() needs non-NULL value");
return -1;
}