gh-83004: Clean up refleak in _zoneinfo initialisation (#98842)

This commit is contained in:
Shantanu 2022-11-06 06:04:36 -08:00 committed by GitHub
parent 99e2e60cb2
commit 31f2f6568d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -0,0 +1 @@
Clean up refleak on failed module initialisation in :mod:`_zoneinfo`

View File

@ -2657,8 +2657,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 */
_tzpath_find_tzfile =