[issue2446] 2to3 translates "import foobar" to "import .foobar" rather than "from . import foobar"

Collin Winter report at bugs.python.org
Fri Mar 28 21:41:54 CET 2008


Collin Winter <collinw at gmail.com> added the comment:

Looking at it, I was confused by a quirk introduced into test_fixers:
Test_import's check_both() helper method does the wrong thing in this case:

a = "import os"
self.check_both(a, a)  # Fails, tries to translate "import os" into
"from . import os"

self.unchanged(a) passes, though. What's going on with these methods?

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2446>
__________________________________


More information about the Python-bugs-list mailing list