https://github.com/python/cpython/commit/34f9b3e7244615d2372614b20e10250e68cc8e61
commit: 34f9b3e7244615d2372614b20e10250e68cc8e61
branch: main
author: Kirill Podoprigora <[email protected]>
committer: ericsnowcurrently <[email protected]>
date: 2024-05-29T09:43:03-06:00
summary:
gh-119655: Fix reference leak in the ``_datetimemodule.c`` (gh-119713)
files:
M Modules/_datetimemodule.c
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c
index b72a5d3c70b92a..466382b5148509 100644
--- a/Modules/_datetimemodule.c
+++ b/Modules/_datetimemodule.c
@@ -6972,10 +6972,13 @@ _datetime_exec(PyObject *module)
} while (0)
PyTypeObject *PyDateTime_IsoCalendarDateType = NULL;
- CREATE_TYPE(PyDateTime_IsoCalendarDateType, &isocal_spec, &PyTuple_Type);
+ datetime_state *st = get_datetime_state();
+
+ if (!st->initialized) {
+ CREATE_TYPE(PyDateTime_IsoCalendarDateType, &isocal_spec,
&PyTuple_Type);
+ }
#undef CREATE_TYPE
- datetime_state *st = get_datetime_state();
if (init_state(st, PyDateTime_IsoCalendarDateType) < 0) {
goto error;
}
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]