Skip to content

Commit 0c1e7e1

Browse files
Update specialize.c
1 parent f79e41a commit 0c1e7e1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Python/specialize.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -644,12 +644,12 @@ specialize_dict_access_hint(
644644
SPECIALIZATION_FAIL(base_op, SPEC_FAIL_ATTR_SPLIT_DICT);
645645
return 0;
646646
}
647-
#ifdef Py_GIL_DISABLED
648647
PyObject *value;
649648
Py_ssize_t index = _PyDict_LookupIndexAndValue(dict, name, &value);
650-
#else
651-
Py_ssize_t index = _PyDict_LookupIndex(dict, name);
652-
#endif
649+
if (value != NULL && PyLazyImport_CheckExact(value)) {
650+
SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_ATTR_MODULE_LAZY_VALUE);
651+
return -1;
652+
}
653653
if (index != (uint16_t)index) {
654654
SPECIALIZATION_FAIL(base_op,
655655
index == DKIX_EMPTY ?

0 commit comments

Comments
 (0)