Improve absolute import management for iptest.py
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
IPython |
Triaged
|
Medium
|
Fernando Perez |
Bug Description
On Mon, Jan 11, 2010 at 11:36 AM, Jörgen Stenarson <email address hidden> wrote:
> I often run IPython/
> now due to a relative import:
>
> C:\python\
> Traceback (most recent call last):
> File "testing\
> from . import globalipapp
> ValueError: Attempted relative import in non-package
Argh, yes. This is unfortunately only fixed for 2.6:
http://
We might just add that boilerplate
if __name__ == "__main__" and __package__ is None:
__package__ = "expected.
protected by a version check, so your approach continues to work.
Changed in ipython: | |
assignee: | nobody → Fernando Perez (fdo.perez) |