Skip to content

Commit a12c0e1

Browse files
Update specialize.c
1 parent 143dd0f commit a12c0e1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Python/specialize.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,12 +644,16 @@ specialize_dict_access_hint(
644644
SPECIALIZATION_FAIL(base_op, SPEC_FAIL_ATTR_SPLIT_DICT);
645645
return 0;
646646
}
647+
#ifdef PY_GIL_DISABLED
647648
PyObject *value;
648649
Py_ssize_t index = _PyDict_LookupIndexAndValue(dict, name, &value);
649650
if (value != NULL && PyLazyImport_CheckExact(value)) {
650651
SPECIALIZATION_FAIL(base_op, SPEC_FAIL_ATTR_MODULE_LAZY_VALUE);
651652
return 0;
652653
}
654+
#else
655+
Py_ssize_t index = _PyDict_LookupIndex(dict, name);
656+
#endif
653657
if (index != (uint16_t)index) {
654658
SPECIALIZATION_FAIL(base_op,
655659
index == DKIX_EMPTY ?

0 commit comments

Comments
 (0)