mirror of https://github.com/python/cpython
gh-119655: Fix reference leak in the ``_datetimemodule.c`` (gh-119713)
This commit is contained in:
parent
1f481fd327
commit
34f9b3e724
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue