diff options
Diffstat (limited to 'Objects/moduleobject.c')
-rw-r--r-- | Objects/moduleobject.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c index 08e9740..f2fed30 100644 --- a/Objects/moduleobject.c +++ b/Objects/moduleobject.c @@ -122,7 +122,8 @@ _PyModule_Clear(PyObject *m) if (s[0] == '_' && s[1] != '_') { if (Py_VerboseFlag > 1) PySys_WriteStderr("# clear[1] %s\n", s); - PyDict_SetItem(d, key, Py_None); + if (PyDict_SetItem(d, key, Py_None) != 0) + PyErr_Clear(); } } } @@ -135,7 +136,8 @@ _PyModule_Clear(PyObject *m) if (s[0] != '_' || strcmp(s, "__builtins__") != 0) { if (Py_VerboseFlag > 1) PySys_WriteStderr("# clear[2] %s\n", s); - PyDict_SetItem(d, key, Py_None); + if (PyDict_SetItem(d, key, Py_None) != 0) + PyErr_Clear(); } } } |