summaryrefslogtreecommitdiffstats
path: root/Objects/moduleobject.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-02-12 07:55:45 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-02-12 07:55:45 (GMT)
commit226c57100c70c42eca199e1c701d5bd17a135cce (patch)
tree1c49cc25e261c998368018dc6f9869b0de61176f /Objects/moduleobject.c
parent2167e29d31a2ea59fdec8b49ab48ff8f460cdf8c (diff)
parent1f9d11b986c95005fbebb724ee3425ad2eb30967 (diff)
downloadcpython-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.c6
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();
}
}
}