[Python-checkins] r73771 - in sandbox/trunk/2to3/lib2to3: fixes/fix_imports.py tests/test_fixers.py
benjamin.peterson
python-checkins at python.org
Thu Jul 2 17:56:56 CEST 2009
Author: benjamin.peterson
Date: Thu Jul 2 17:56:55 2009
New Revision: 73771
Log:
force the imports fixer to be run after the import one #6400
Modified:
sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py
sandbox/trunk/2to3/lib2to3/tests/test_fixers.py
Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py
==============================================================================
--- sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py (original)
+++ sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py Thu Jul 2 17:56:55 2009
@@ -84,8 +84,6 @@
class FixImports(fixer_base.BaseFix):
- order = "pre" # Pre-order tree traversal
-
# This is overridden in fix_imports2.
mapping = MAPPING
Modified: sandbox/trunk/2to3/lib2to3/tests/test_fixers.py
==============================================================================
--- sandbox/trunk/2to3/lib2to3/tests/test_fixers.py (original)
+++ sandbox/trunk/2to3/lib2to3/tests/test_fixers.py Thu Jul 2 17:56:55 2009
@@ -1703,6 +1703,11 @@
for key in ('dbhash', 'dumbdbm', 'dbm', 'gdbm'):
self.modules[key] = mapping1[key]
+ def test_after_local_imports_refactoring(self):
+ for fix in ("imports", "imports2"):
+ self.fixer = fix
+ self.assert_runs_after("import")
+
class Test_urllib(FixerTestCase):
fixer = "urllib"
@@ -3502,6 +3507,7 @@
s = "from itertools import foo"
self.unchanged(s)
+
class Test_import(FixerTestCase):
fixer = "import"
More information about the Python-checkins
mailing list