Code Management

BlueBird phil at freehackers.org
Sun Dec 2 10:27:24 EST 2007


On Nov 26, 5:07 pm, "Sergio Correia" <sergio.corr... at gmail.com> wrote:
> Bluebird:
>
> If you are using python 2.5, relative imports are no longer an
> issue:http://docs.python.org/whatsnew/pep-328.html

It does not solve my problem, or I missed something:

User at Phil_vaio /cygdrive/d/work/work/vy-dev/foo $ find . -name '*.py'
./bar/bar.py
./bar/tests/test_bar.py
./bar/tests/test_bar1.py
./bar/tests/__init__.py
./bar/__init__.py
./foo/foo.py
./foo/tests/__init__.py
./foo/__init__.py
./__init__.py

d:\work\work\vy-dev\foo>C:\Python25\python.exe  bar/tests/test_bar.py
d:\work\work\vy-dev\foo
['d:\\work\\work\\vy-dev\\foo\\bar\\tests', 'C:\\Python25\\lib\\site-
packages\\h
gsvn-0.1.4-py2.5.egg', 'C:\\WINDOWS\\system32\\python25.zip', 'C:\
\Python25\\DLL
s', 'C:\\Python25\\lib', 'C:\\Python25\\lib\\plat-win', 'C:\\Python25\
\lib\\lib-
tk', 'C:\\Python25', 'C:\\Python25\\lib\\site-packages', 'C:\\Python25\
\lib\\sit
e-packages\\win32', 'C:\\Python25\\lib\\site-packages\\win32\\lib', 'C:
\\Python2
5\\lib\\site-packages\\Pythonwin', 'C:\\Python25\\lib\\site-packages\
\wx-2.8-msw
-ansi']
Traceback (most recent call last):
  File "bar/tests/test_bar.py", line 8, in <module>
    from ..bar import bar_f
ValueError: Attempted relative import in non-package




More information about the Python-list mailing list