[New-bugs-announce] [issue13187] relative imports don't work when circular

Antoine Pitrou report at bugs.python.org
Sat Oct 15 22:28:45 CEST 2011


New submission from Antoine Pitrou <pitrou at free.fr>:

This is, to say the least, annoying.

$ mkdir mypackage
$ touch mypackage/__init__.py
$ echo "from . import b" > mypackage/a.py
$ echo "from . import a" > mypackage/b.py
$ ./python -c "import mypackage.a"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "mypackage/a.py", line 1, in <module>
    from . import b
  File "mypackage/b.py", line 1, in <module>
    from . import a
ImportError: cannot import name a

----------
components: Interpreter Core
messages: 145606
nosy: ncoghlan, pitrou
priority: normal
severity: normal
status: open
title: relative imports don't work when circular
type: behavior
versions: Python 3.2, Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13187>
_______________________________________


More information about the New-bugs-announce mailing list