[issue17393] stdlib import mistaken for local by import_fixer

Lennart Regebro report at bugs.python.org
Mon Mar 11 07:08:03 CET 2013


Lennart Regebro added the comment:

Not really, but they are related. The fixer looks for a local module, and if it finds it it will assume the import is local. 

#13317 is caused by it not finding the module, since it's not built and hence assuming it's a global import.

This bug, contrariwise, is cause by the fixer finding a folder, and therefore assuming it is a local import when it's not.

The fix for this is to check that the folder has an __init__.py. The fix for #13317 is to build extensions before running 2to3.

Neither of them are huge problems since you can avoid both bugs but not using relative imports. :-)

----------

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


More information about the Python-bugs-list mailing list