A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-September/068942.html below:

[Python-Dev] Relative import bug?

[Python-Dev] Relative import bug? [Python-Dev] Relative import bug?Thomas Heller theller at python.net
Fri Sep 22 20:10:23 CEST 2006
Consider a package containing these files:

a/__init__.py
a/b/__init__.py
a/b/x.py
a/b/y.py

If x.py contains this:

"""
from ..b import y
import a.b.x
from ..b import x
"""

Python trunk and Python 2.5 both complain:

Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import a.b.x
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "a\b\x.py", line 2, in <module>
    from ..b import x
ImportError: cannot import name x
>>>

A bug?

Thomas

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4