Message9438
This problem is absent without "from __future__ import absolute_import".
$ cd /tmp
$ mkdir test
$ touch test/__init__.py
$ echo $'from __future__ import absolute_import\nfrom . import *' > test/x.py
$ echo $'from __future__ import absolute_import\nfrom .z import *' > test/y.py
$ touch test/z.py
$ tree test
test
├── __init__.py
├── x.py
├── y.py
└── z.py
0 directories, 4 files
$ cat test/x.py
from __future__ import absolute_import
from . import *
$ cat test/y.py
from __future__ import absolute_import
from .z import *
$ python2.7 -c 'import test.x'
$ python2.7 -c 'import test.y'
$ jython2.7 -c 'import test.x'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "test/x.py", line 2, in <module>
from . import *
ValueError: Empty module name
$ jython2.7 -c 'import test.y'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "test/y.py", line 2, in <module>
from .z import *
ImportError: No module named z
$ |
|
Date |
User |
Action |
Args |
2015-01-21 23:59:21 | Arfrever | set | recipients:
+ Arfrever, fwierzbicki, zyasoft, tkanerva |
2015-01-21 23:59:21 | Arfrever | set | messageid: <1421884761.73.0.323129373674.issue2259@psf.upfronthosting.co.za> |
2015-01-21 23:59:21 | Arfrever | link | issue2259 messages |
2015-01-21 23:59:21 | Arfrever | create | |
|