Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update Modules/errnomodule.c
Co-authored-by: Victor Stinner <vstinner@python.org>
  • Loading branch information
corona10 and vstinner authored May 6, 2020
commit 9c94c4f249b660ec798b12b35eb102088751528c
6 changes: 5 additions & 1 deletion Modules/errnomodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ errno_exec(PyObject *module)
{
PyObject *module_dict = PyModule_GetDict(module);
PyObject *error_dict = PyDict_New();
if (!module_dict || !error_dict || PyDict_SetItemString(module_dict, "errorcode", error_dict) < 0) {
if (!module_dict || !error_dict) {
return -1;
}
if (PyDict_SetItemString(module_dict, "errorcode", error_dict) < 0) {
Py_DECREF(error_dict);
return -1;
}

Expand Down