From f8d59d28e0867c82b647d94c0aecd9e1c3accd9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Fri, 24 Oct 2003 20:05:32 +0000 Subject: Patch #828384: Don't discard nested exception in AddObject. --- Python/modsupport.c | 5 +++-- 1 file 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; } -- cgit v0.12