mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
gh-83004: Clean up refleak in _zoneinfo initialisation (GH-98842)
(cherry picked from commit 31f2f6568d
)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
This commit is contained in:
parent
be4bab8c2b
commit
4b1e45e78b
2 changed files with 4 additions and 2 deletions
|
@ -0,0 +1 @@
|
|||
Clean up refleak on failed module initialisation in :mod:`_zoneinfo`
|
|
@ -2652,8 +2652,9 @@ zoneinfomodule_exec(PyObject *m)
|
|||
goto error;
|
||||
}
|
||||
|
||||
Py_INCREF(&PyZoneInfo_ZoneInfoType);
|
||||
PyModule_AddObject(m, "ZoneInfo", (PyObject *)&PyZoneInfo_ZoneInfoType);
|
||||
if (PyModule_AddObjectRef(m, "ZoneInfo", (PyObject *)&PyZoneInfo_ZoneInfoType) < 0) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* Populate imports */
|
||||
PyObject *_tzpath_module = PyImport_ImportModule("zoneinfo._tzpath");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue