Nick Coghlan <ncogh...@gmail.com> added the comment:

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 :)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15314>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to