summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-02-12 07:55:01 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-02-12 07:55:01 (GMT)
commit1f9d11b986c95005fbebb724ee3425ad2eb30967 (patch)
tree87b1aceb9935ea8e8943012fa15e698dfd4d3dc3 /Objects
parent892f4f9360bf7d8b276f538defe7ab11593efda8 (diff)
downloadcpython-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.c6
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();
}
}
}