mirror of
https://github.com/python/cpython.git
synced 2026-04-24 21:01:04 +00:00
gh-143469: enable LOAD_ATTR_MODULE specialization even if __getattr__ is defined (#143470)
This commit is contained in:
parent
05406b221d
commit
faa3dc7c64
3 changed files with 40 additions and 7 deletions
|
|
@ -366,14 +366,8 @@ specialize_module_load_attr_lock_held(PyDictObject *dict, _Py_CODEUNIT *instr, P
|
|||
SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_ATTR_NON_STRING);
|
||||
return -1;
|
||||
}
|
||||
Py_ssize_t index = _PyDict_LookupIndex(dict, &_Py_ID(__getattr__));
|
||||
Py_ssize_t index = _PyDict_LookupIndex(dict, name);
|
||||
assert(index != DKIX_ERROR);
|
||||
if (index != DKIX_EMPTY) {
|
||||
SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_ATTR_MODULE_ATTR_NOT_FOUND);
|
||||
return -1;
|
||||
}
|
||||
index = _PyDict_LookupIndex(dict, name);
|
||||
assert (index != DKIX_ERROR);
|
||||
if (index != (uint16_t)index) {
|
||||
SPECIALIZATION_FAIL(LOAD_ATTR,
|
||||
index == DKIX_EMPTY ?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue