Import statement doesn't work as expected with Python 3.3 -


i ported django application python 2.7 python 3.3 django1.6b1.

my import statements wouldn't work anymore custom module imports (user, views...) , had add dot before these imports. why ?

example :

import emailuser #worked python 2.7 doesn't work 3.3     import .emailuser #works     

not bug; python 3 forces explicit relative imports.

from docs:

the acceptable syntax relative imports from .[module] import name. import forms not starting . interpreted absolute imports. (pep 0328)


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -