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 f79e41a commit 0c1e7e1Copy full SHA for 0c1e7e1
Python/specialize.c
@@ -644,12 +644,12 @@ specialize_dict_access_hint(
644
SPECIALIZATION_FAIL(base_op, SPEC_FAIL_ATTR_SPLIT_DICT);
645
return 0;
646
}
647
-#ifdef Py_GIL_DISABLED
648
PyObject *value;
649
Py_ssize_t index = _PyDict_LookupIndexAndValue(dict, name, &value);
650
-#else
651
- Py_ssize_t index = _PyDict_LookupIndex(dict, name);
652
-#endif
+ if (value != NULL && PyLazyImport_CheckExact(value)) {
+ SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_ATTR_MODULE_LAZY_VALUE);
+ return -1;
+ }
653
if (index != (uint16_t)index) {
654
SPECIALIZATION_FAIL(base_op,
655
index == DKIX_EMPTY ?
0 commit comments