Skip to content

Commit ed65682

Browse files
committed
Move to pycore_init_types()
1 parent e16fb54 commit ed65682

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Include/internal/pycore_pylifecycle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ extern PyStatus _Py_HashRandomization_Init(const PyConfig *);
4141

4242
extern PyStatus _PyGC_Init(PyInterpreterState *interp);
4343
extern PyStatus _PyAtExit_Init(PyInterpreterState *interp);
44-
extern PyStatus _PyDateTime_Init(PyInterpreterState *interp);
44+
extern PyStatus _PyDateTime_InitTypes(PyInterpreterState *interp);
4545

4646
/* Various internal finalizers */
4747

Modules/_datetimemodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7331,7 +7331,7 @@ clear_state(datetime_state *st)
73317331

73327332

73337333
PyStatus
7334-
_PyDateTime_Init(PyInterpreterState *interp)
7334+
_PyDateTime_InitTypes(PyInterpreterState *interp)
73357335
{
73367336
// `&...` is not a constant expression according to a strict reading
73377337
// of C standards. Fill tp_base at run-time rather than statically.

Python/pylifecycle.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,11 @@ pycore_init_types(PyInterpreterState *interp)
760760
return status;
761761
}
762762

763+
status = _PyDateTime_InitTypes(interp);
764+
if (_PyStatus_EXCEPTION(status)) {
765+
return status;
766+
}
767+
763768
return _PyStatus_OK();
764769
}
765770

@@ -915,11 +920,6 @@ pycore_interp_init(PyThreadState *tstate)
915920
goto done;
916921
}
917922

918-
status = _PyDateTime_Init(tstate->interp);
919-
if (_PyStatus_EXCEPTION(status)) {
920-
goto done;
921-
}
922-
923923
const PyConfig *config = _PyInterpreterState_GetConfig(interp);
924924

925925
status = _PyImport_InitCore(tstate, sysmod, config->_install_importlib);

0 commit comments

Comments
 (0)