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

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -