This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients brett.cannon, eric.snow, jaraco, ncoghlan
Date 2012-01-31.12:02:07
SpamBayes Score 0.0014142179
Marked as misclassified No
Message-id <1328011329.93.0.52252821481.issue13912@psf.upfronthosting.co.za>
In-reply-to
Content
It sounds like you may want runpy.run_module [1], rather than using imports at all. If you know how many levels up you want to go, it isn't hard to do your own munging of __name__ to create absolute module references to pass to runpy.

The signature of __import__ is known to be unintuitive to the point of being insane - it's really designed for the convenience of the compiler and the interpreter, not for direct use by humans.

[1] http://docs.python.org/release/2.6.7/library/runpy#runpy.run_module
History
Date User Action Args
2012-01-31 12:02:10ncoghlansetrecipients: + ncoghlan, brett.cannon, jaraco, eric.snow
2012-01-31 12:02:09ncoghlansetmessageid: <1328011329.93.0.52252821481.issue13912@psf.upfronthosting.co.za>
2012-01-31 12:02:07ncoghlanlinkissue13912 messages
2012-01-31 12:02:07ncoghlancreate