mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
bpo-42979: _zoneinfo exec function checks for PyDateTime_IMPORT failure (GH-24333)
Importing datetime can fail.
This commit is contained in:
@@ -2629,6 +2629,9 @@ static int
|
||||
zoneinfomodule_exec(PyObject *m)
|
||||
{
|
||||
PyDateTime_IMPORT;
|
||||
if (PyDateTimeAPI == NULL) {
|
||||
goto error;
|
||||
}
|
||||
PyZoneInfo_ZoneInfoType.tp_base = PyDateTimeAPI->TZInfoType;
|
||||
if (PyType_Ready(&PyZoneInfo_ZoneInfoType) < 0) {
|
||||
goto error;
|
||||
|
||||
Reference in New Issue
Block a user