diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-02-12 07:55:01 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-02-12 07:55:01 (GMT) |
commit | 1f9d11b986c95005fbebb724ee3425ad2eb30967 (patch) | |
tree | 87b1aceb9935ea8e8943012fa15e698dfd4d3dc3 /Objects | |
parent | 892f4f9360bf7d8b276f538defe7ab11593efda8 (diff) | |
download | cpython-1f9d11b986c95005fbebb724ee3425ad2eb30967.zip cpython-1f9d11b986c95005fbebb724ee3425ad2eb30967.tar.gz cpython-1f9d11b986c95005fbebb724ee3425ad2eb30967.tar.bz2 |
Issue #19255: Clear error after failed PyDict_SetItem() on shutdown.
This silences a Coverity complain.
Diffstat (limited to 'Objects')
-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 2f2bd36..72978ae 100644 --- a/Objects/moduleobject.c +++ b/Objects/moduleobject.c @@ -300,7 +300,8 @@ _PyModule_Clear(PyObject *m) else PyErr_Clear(); } - PyDict_SetItem(d, key, Py_None); + if (PyDict_SetItem(d, key, Py_None) != 0) + PyErr_Clear(); } } } @@ -319,7 +320,8 @@ _PyModule_Clear(PyObject *m) else PyErr_Clear(); } - PyDict_SetItem(d, key, Py_None); + if (PyDict_SetItem(d, key, Py_None) != 0) + PyErr_Clear(); } } } |