[New-bugs-announce] [issue16846] relative import solution
FizzledOut
report at bugs.python.org
Thu Jan 3 06:52:11 CET 2013
New submission from FizzledOut:
Instead of giving the error message " Attempted relative import in non-package", simply process the line!
from . import Example
whether or not the file is __main__, it should be able to go up one directory, if possible, and try to import Example.py. It makes no sense that this cannot be done.
----------
components: Windows
messages: 178913
nosy: Fixpythonbugs
priority: normal
severity: normal
status: open
title: relative import solution
type: resource usage
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16846>
_______________________________________
More information about the New-bugs-announce
mailing list