Uh oh!
There was an error while loading. Please reload this page.
bpo-20490: Improve circular import error messaging - #15308
Conversation
asottile
commented
Aug 15, 2019
This is largely based on the work in https://bugs.python.org/issue33237 by @serhiy-storchaka#6398 |
asottile
commented
Aug 15, 2019
demo$ tail -n999 a/*.py==> a/b.py <==from a.c import de = 1==> a/c.py <==from a.b import ed = 1==> a/__init__.py <==before$ python3.8 -c 'import a.b'Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/x/a/b.py", line 1, in <module> from a.c import d File "/tmp/x/a/c.py", line 1, in <module> from a.b import eImportError: cannot import name 'e' from 'a.b' (/tmp/x/a/b.py)after$ ~/workspace/cpython/python -c 'import a.b'Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/x/a/b.py", line 1, in <module> from a.c import d File "/tmp/x/a/c.py", line 1, in <module> from a.b import eImportError: cannot import name 'e' from 'a.b' (partially initialized module -- most likely due to a circular import) (/tmp/x/a/b.py) |
cool-RR
commented
Aug 15, 2019
Thanks for working on this @asottile ! If this old idea will come true, that'd be cool. |
3d72f86 to
550209cCompared56ddb9 to
e7b41f9Compare5d18cf9 to
efacf0fCompareasottile
commented
Aug 21, 2019
(I'm rebasing to presumably fix the CI failure -- it doesn't seem related to my change, but I've been surprised before by macos 😆) |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
efacf0f to
6ac3cf1CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
6ac3cf1 to
5feaa0cComparemiss-islington
commented
Sep 9, 2019
miss-islington
commented
Sep 9, 2019
Sorry @asottile and @zooba, I had trouble checking out the |
bedevere-bot
commented
Sep 9, 2019
GH-15791 is a backport of this pull request to the 3.8 branch. |
This pull request introduced a reference leak: https://buildbot.python.org/all/#/builders/1/builds/710 This is being tracked in: |
https://bugs.python.org/issue20490