mirror of
https://github.com/python/cpython.git
synced 2024-11-27 11:55:13 +08:00
Issue #19255: Clear error after failed PyDict_SetItem() on shutdown.
This silences a Coverity complain.
This commit is contained in:
commit
226c57100c
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user