mirror of
https://github.com/python/cpython.git
synced 2024-11-25 19:03:49 +08:00
Patch #828384: Don't discard nested exception in AddObject.
This commit is contained in:
parent
7883dc8abb
commit
f8d59d28e0
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user