Message152342
Sorry for the mistake.
I corrected the pkgB package, but the result is the same:
jaraco@devjaraco:~$ tree master
master
├── __init__.py
├── __init__.pyc
├── pkgA
│ ├── foo.py
│ ├── foo.pyc
│ ├── __init__.py
│ └── __init__.pyc
└── pkgB
├── bar.py
└── __init__.py
2 directories, 8 files
jaraco@devjaraco:~$ python2.7 -c 'import master.pkgA; print("pkgA.__package__ is {}".format(master.pkgA.__package__)); import master.pkgA.foo'
pkgA.__package__ is None
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "master/pkgA/foo.py", line 2, in <module>
bar = __import__('pkgB', level=1).bar
ImportError: No module named pkgB
As you can see, __package__ for pkgA is None. Same is true for master.__package__. |
|
Date |
User |
Action |
Args |
2012-01-30 19:31:06 | jaraco | set | recipients:
+ jaraco, brett.cannon, eric.snow |
2012-01-30 19:31:06 | jaraco | set | messageid: <1327951866.42.0.131744955264.issue13912@psf.upfronthosting.co.za> |
2012-01-30 19:31:05 | jaraco | link | issue13912 messages |
2012-01-30 19:31:05 | jaraco | create | |
|