-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
Improve AttributeError on circular imports of submodules #88880
Comments
Consider the following $ tree a
a
├── b
│ ├── c.py
│ └── __init__.py
└── __init__.py 1 directory, 3 files a.b
$ python
Python 3.9.6 (default, Jun 30 2021, 10:22:16)
[GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import a.b
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/anubis/test/a/b/__init__.py", line 1, in <module>
import a.b.c
File "/home/anubis/test/a/b/c.py", line 3, in <module>
a.b
AttributeError: module 'a' has no attribute 'b' This happens because even though the module |
Thanks a lot for your report and patch, Filipe! ✨ 🍰 ✨ |
There is a buildbot failure after merging this PR: https://buildbot.python.org/all/#/builders/464/builds/574 If is not fixed in 24 we will need to revert per our buildbot policy |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: