-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix AttributeError
crash when using --import-mode=importlib
#13029
Conversation
AttributeError
crash when using --import-mode=importlib
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @dongfangtianyu for investigating it and opening a fix so quickly!
Left some small comments, can you take a look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Backport to 8.3.x: 💚 backport PR created✅ Backport PR branch: Backported as #13037 🤖 @patchback |
…) (#13037) Only parent modules with the `__path__` attribute can be used by the `find_spec` function, and most of the standard library does not meet this condition. Fixes #13026 . (cherry picked from commit 8cff128) Co-authored-by: dongfangtianyu <7629022+dongfangtianyu@users.noreply.github.com>
closes #13026 .
changelog
folder.Only parent modules with the
__path__
attribute can be used by thefind_spec
function, and most of the standard library does not meet this condition.https://github.com/python/cpython/blob/3.9/Lib/importlib/_bootstrap_external.py#L1223
So this PR adds a condition check.