mirror of
https://github.com/python/cpython.git
synced 2025-10-05 14:41:07 +00:00
bpo-43033: Fix the handling of PyObject_SetAttrString() in _zoneinfo.c (GH-24345) (GH-24349)
(cherry picked from commit 5327f37034
)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
This commit is contained in:
parent
68102fb998
commit
cb77c5e1dd
1 changed files with 5 additions and 1 deletions
|
@ -2530,7 +2530,11 @@ zoneinfo_init_subclass(PyTypeObject *cls, PyObject *args, PyObject **kwargs)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
PyObject_SetAttrString((PyObject *)cls, "_weak_cache", weak_cache);
|
if (PyObject_SetAttrString((PyObject *)cls, "_weak_cache",
|
||||||
|
weak_cache) < 0) {
|
||||||
|
Py_DECREF(weak_cache);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
Py_DECREF(weak_cache);
|
Py_DECREF(weak_cache);
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue