Skip to content

Commit

Permalink
Check the import of datetime's capi succeeded or not in zoneinfo.
Browse files Browse the repository at this point in the history
  • Loading branch information
s00424258 authored and pganssle committed May 25, 2021
1 parent 959cd91 commit c54d700
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/zoneinfo_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -2647,6 +2647,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;
Expand Down

0 comments on commit c54d700

Please sign in to comment.