Message152375
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 |
|
Date |
User |
Action |
Args |
2012-01-31 12:02:10 | ncoghlan | set | recipients:
+ ncoghlan, brett.cannon, jaraco, eric.snow |
2012-01-31 12:02:09 | ncoghlan | set | messageid: <1328011329.93.0.52252821481.issue13912@psf.upfronthosting.co.za> |
2012-01-31 12:02:07 | ncoghlan | link | issue13912 messages |
2012-01-31 12:02:07 | ncoghlan | create | |
|