Skip to content

Commit f408c67

Browse files
Update specialize.c
1 parent eaeffd7 commit f408c67

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
@@ -383,12 +383,16 @@ specialize_module_load_attr_lock_held(PyDictObject *dict, _Py_CODEUNIT *instr, P
383383
SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_ATTR_NON_STRING);
384384
return -1;
385385
}
386+
#ifdef Py_GIL_DISABLED
386387
PyObject *value;
387388
Py_ssize_t index = _PyDict_LookupIndexAndValue(dict, name, &value);
388389
if (value != NULL && PyLazyImport_CheckExact(value)) {
389390
SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_ATTR_MODULE_LAZY_VALUE);
390391
return -1;
391392
}
393+
#else
394+
Py_ssize_t index = _PyDict_LookupIndexAndValue(dict, name);
395+
#endif
392396
assert(index != DKIX_ERROR);
393397
if (index != (uint16_t)index) {
394398
SPECIALIZATION_FAIL(LOAD_ATTR,

0 commit comments

Comments
 (0)