summaryrefslogtreecommitdiffstats
path: root/Python/modsupport.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2003-10-24 20:05:32 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2003-10-24 20:05:32 (GMT)
commitf8d59d28e0867c82b647d94c0aecd9e1c3accd9e (patch)
treeb08d6446556517aa822914216f2f3691c3dffaab /Python/modsupport.c
parent7883dc8abb81026fb111b2fde09ba602ccf04226 (diff)
downloadcpython-f8d59d28e0867c82b647d94c0aecd9e1c3accd9e.zip
cpython-f8d59d28e0867c82b647d94c0aecd9e1c3accd9e.tar.gz
cpython-f8d59d28e0867c82b647d94c0aecd9e1c3accd9e.tar.bz2
Patch #828384: Don't discard nested exception in AddObject.
Diffstat (limited to 'Python/modsupport.c')
-rw-r--r--Python/modsupport.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/modsupport.c b/Python/modsupport.c
index b4640b0..ec85511 100644
--- a/Python/modsupport.c
+++ b/Python/modsupport.c
@@ -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;
}