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

2008-10-20 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: I fixed this is r66707. -- nosy: +benjamin.peterson resolution: -> fixed status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> ___

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

2008-03-28 Thread David Wolever
David Wolever <[EMAIL PROTECTED]> added the comment: Ah, yes -- that may be the fault of the confusingly named 'check_both'. The "both" means "both when the module in question exists and when it does not". If you've got a better name, please change it! Take a look at the method and you'll

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

2008-03-28 Thread Collin Winter
Collin Winter <[EMAIL PROTECTED]> 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 . impor

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

2008-03-28 Thread David Wolever
David Wolever <[EMAIL PROTECTED]> added the comment: Can you write a test case proving this? At the moment, the second thing that the transform function in fix_import.py does is return if the import doesn't look like a local import (see probably_a_local_import in fix_import). At the moment,

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

2008-03-28 Thread Collin Winter
Collin Winter <[EMAIL PROTECTED]> added the comment: The problem with the "fix" in r61755 is that it doesn't distinguish between stdlib and non-stdlib imports: "import os" becomes "from . import os", which is clearly wrong. __ Tracker <[EMAIL PROTECTED]>

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

2008-03-22 Thread David Wolever
David Wolever <[EMAIL PROTECTED]> added the comment: Ok, I've fixed this in r61755. I _think_ it does the right thing, but it might be good if someone else checks out the test cases to make sure. __ Tracker <[EMAIL PROTECTED]>

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

2008-03-21 Thread Martin v. Löwis
Changes by Martin v. Löwis <[EMAIL PROTECTED]>: -- nosy: +loewis __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscrib

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

2008-03-21 Thread Collin Winter
Changes by Collin Winter <[EMAIL PROTECTED]>: -- assignee: collinwinter -> David Wolever nosy: +David Wolever __ Tracker <[EMAIL PROTECTED]> __

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

2008-03-21 Thread Bruce Frederiksen
New submission from Bruce Frederiksen <[EMAIL PROTECTED]>: 2to3 svn rev 61696 translates "import local_module" into "import .local_module" which isn't legal syntax. Should be "from . import local_module". -- assignee: collinwinter components: 2to3 (2.x to 3.0 conversion tool) messages: