From 1f9d11b986c95005fbebb724ee3425ad2eb30967 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Wed, 12 Feb 2014 09:55:01 +0200 Subject: Issue #19255: Clear error after failed PyDict_SetItem() on shutdown. This silences a Coverity complain. --- Objects/moduleobject.c | 6 ++++-- 1 file 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(); } } } -- cgit v0.12