We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c9d200 commit 836f5cfCopy full SHA for 836f5cf
Modules/_testmultiphase.c
@@ -959,15 +959,18 @@ PyInit__test_shared_gil_only(void)
959
static int
960
datetime_capi_exec(PyObject *m)
961
{
962
- _pydatetimeapi_main = NULL;
+ int ismain = PyInterpreterState_Get() == PyInterpreterState_Main();
963
+ if (ismain) {
964
+ _pydatetimeapi_main = NULL;
965
+ }
966
PyDateTime_IMPORT;
967
if (PyDateTimeAPI == NULL) {
968
return -1;
969
}
970
if (PyDateTimeAPI != PyCapsule_Import(PyDateTime_CAPSULE_NAME, 0)) {
971
972
- if (PyInterpreterState_Get() == PyInterpreterState_Main()) {
973
974
if (PyDateTimeAPI != _pydatetimeapi_main) {
975
976
0 commit comments