diff options
author | Sergey B Kirpichev <skirpichev@gmail.com> | 2024-11-15 08:03:38 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-15 08:03:38 (GMT) |
commit | d9e251223e8314ca726fc0be8b834362184b0aad (patch) | |
tree | 27573aba3de90484f984bd608db7594961bb5a60 /Python/specialize.c | |
parent | 3fecbe9255391be1ac3c3b52dfe0254ee5c665bd (diff) | |
download | cpython-d9e251223e8314ca726fc0be8b834362184b0aad.zip cpython-d9e251223e8314ca726fc0be8b834362184b0aad.tar.gz cpython-d9e251223e8314ca726fc0be8b834362184b0aad.tar.bz2 |
gh-103951: enable optimization for fast attribute access on module subclasses (GH-126264)
Co-authored-by: Nicolas Tessore <n.tessore@ucl.ac.uk>
Diffstat (limited to 'Python/specialize.c')
-rw-r--r-- | Python/specialize.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/specialize.c b/Python/specialize.c index 0699e7b..4c8cf85 100644 --- a/Python/specialize.c +++ b/Python/specialize.c @@ -1219,7 +1219,7 @@ _Py_Specialize_LoadAttr(_PyStackRef owner_st, _Py_CODEUNIT *instr, PyObject *nam SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_OTHER); fail = true; } - else if (PyModule_CheckExact(owner)) { + else if (Py_TYPE(owner)->tp_getattro == PyModule_Type.tp_getattro) { fail = specialize_module_load_attr(owner, instr, name); } else if (PyType_Check(owner)) { |