mirror of
https://github.com/python/cpython.git
synced 2025-10-07 15:42:02 +00:00
bpo-35454: Fix miscellaneous minor issues in error handling. (#11077)
* bpo-35454: Fix miscellaneous minor issues in error handling. * Fix a null pointer dereference.
This commit is contained in:
parent
bb86bf4c4e
commit
8905fcc85a
9 changed files with 44 additions and 23 deletions
|
@ -255,7 +255,11 @@ already_warned(PyObject *registry, PyObject *key, int should_set)
|
|||
version_obj = _PyDict_GetItemId(registry, &PyId_version);
|
||||
if (version_obj == NULL
|
||||
|| !PyLong_CheckExact(version_obj)
|
||||
|| PyLong_AsLong(version_obj) != _PyRuntime.warnings.filters_version) {
|
||||
|| PyLong_AsLong(version_obj) != _PyRuntime.warnings.filters_version)
|
||||
{
|
||||
if (PyErr_Occurred()) {
|
||||
return -1;
|
||||
}
|
||||
PyDict_Clear(registry);
|
||||
version_obj = PyLong_FromLong(_PyRuntime.warnings.filters_version);
|
||||
if (version_obj == NULL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue