diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-02-12 07:55:45 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-02-12 07:55:45 (GMT) |
commit | 226c57100c70c42eca199e1c701d5bd17a135cce (patch) | |
tree | 1c49cc25e261c998368018dc6f9869b0de61176f /Objects/moduleobject.c | |
parent | 2167e29d31a2ea59fdec8b49ab48ff8f460cdf8c (diff) | |
parent | 1f9d11b986c95005fbebb724ee3425ad2eb30967 (diff) | |
download | cpython-226c57100c70c42eca199e1c701d5bd17a135cce.zip cpython-226c57100c70c42eca199e1c701d5bd17a135cce.tar.gz cpython-226c57100c70c42eca199e1c701d5bd17a135cce.tar.bz2 |
Issue #19255: Clear error after failed PyDict_SetItem() on shutdown.
This silences a Coverity complain.
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 6821710..f509932 100644 --- a/Objects/moduleobject.c +++ b/Objects/moduleobject.c @@ -330,7 +330,8 @@ _PyModule_ClearDict(PyObject *d) else PyErr_Clear(); } - PyDict_SetItem(d, key, Py_None); + if (PyDict_SetItem(d, key, Py_None) != 0) + PyErr_Clear(); } } } @@ -349,7 +350,8 @@ _PyModule_ClearDict(PyObject *d) else PyErr_Clear(); } - PyDict_SetItem(d, key, Py_None); + if (PyDict_SetItem(d, key, Py_None) != 0) + PyErr_Clear(); } } } |