[issue17636] Modify IMPORT_FROM to fallback on sys.modules

Antoine Pitrou report at bugs.python.org
Fri Oct 10 00:13:26 CEST 2014


Antoine Pitrou added the comment:

Le 10/10/2014 00:11, Nick Coghlan a écrit :
> 
> Nick Coghlan added the comment:
> 
> If I understand your question correctly, then yes, __package__ should be
> used when converting explicit relative imports to absolute ones.
> 
> To write a test, run a submodule that needs the new fallback feature via
> the -m switch (it will fail if using __name__)

I'm not sure it would. __package__ is not looked up on the module (since
precisely we failed importing it) but on the parent package (which is
passed to IMPORT_FROM).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17636>
_______________________________________


More information about the Python-bugs-list mailing list