Message165504
OK, the way I plan to tackle this is to actually redirect the pkgutil APIs to importlib (rather than using the private import emulation).
The reason I'm going to tackle it like this is that there are some assumptions pkgutil deals with that importlib doesn't. Specifically, runpy expects find_loader() to take care of importing the parent package. In addition, importlib is prone to throwing AttributeError or TypeError for problems where pkgutil consistently throws ImportError. By using pkgutil as a compatibility shim, most code (including runpy itself) will be able to transition to importlib without actually needing any changes.
This approach also brings test_runpy and test_cmd_line_script more fully to bear on the importlib implementation, which is a nice bonus :) |
|
Date |
User |
Action |
Args |
2012-07-15 04:03:03 | ncoghlan | set | recipients:
+ ncoghlan, brett.cannon, georg.brandl, eric.araujo, Arfrever |
2012-07-15 04:03:03 | ncoghlan | set | messageid: <1342324983.22.0.0352403047176.issue15314@psf.upfronthosting.co.za> |
2012-07-15 04:03:02 | ncoghlan | link | issue15314 messages |
2012-07-15 04:03:02 | ncoghlan | create | |
|