[issue15434] __import__() problem in 3.3

Stefan Krah report at bugs.python.org
Mon Jul 23 17:52:34 CEST 2012


Stefan Krah <stefan-usenet at bytereef.org> added the comment:

Argh. __init__.py was missing in the top directory. For some reason
Python 3.2 does not throw the error. Also, 3.3 does not raise in the
case of the a/b directory structure:

$ tree a
a
`-- b
    |-- __init__.py
    `-- xyz.py

$ ~/usr/bin/python3.3 a/b/__init__.py               
['/home/stefan/tmp', '/home/stefan/tmp/a/b', '/home/stefan/usr/lib/python33.zip', '/home/stefan/usr/lib/python3.3', '/home/stefan/usr/lib/python3.3/plat-linux', '/home/stefan/usr/lib/python3.3/lib-dynload', '/home/stefan/.local/lib/python3.3/site-packages', '/home/stefan/usr/lib/python3.3/site-packages']


With the added __init__.py, also the (fake) distutils package is OK:


$ tree distutils/
distutils/
|-- __init__.py
`-- command
    |-- __init__.py
    `-- xyz.py


$ ~/usr/bin/python3.3 distutils/command/__init__.py
['/home/stefan/tmp', '/home/stefan/tmp/distutils/command', '/home/stefan/usr/lib/python33.zip', '/home/stefan/usr/lib/python3.3', '/home/stefan/usr/lib/python3.3/plat-linux', '/home/stefan/usr/lib/python3.3/lib-dynload', '/home/stefan/.local/lib/python3.3/site-packages', '/home/stefan/usr/lib/python3.3/site-packages']




Brett, if this all looks good to you, this issue can be closed. The
original NumPy build error must be due to something else.

Perhaps 3.3 should raise in the a/b case, too?

----------

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


More information about the Python-bugs-list mailing list