[Python-checkins] r83827 - in sandbox/trunk/2to3/lib2to3: fixes/fix_urllib.py tests/test_fixers.py
benjamin.peterson
python-checkins at python.org
Sun Aug 8 15:12:48 CEST 2010
Author: benjamin.peterson
Date: Sun Aug 8 15:12:48 2010
New Revision: 83827
Log:
cause test to actually run and fix it
Modified:
sandbox/trunk/2to3/lib2to3/fixes/fix_urllib.py
sandbox/trunk/2to3/lib2to3/tests/test_fixers.py
Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_urllib.py
==============================================================================
--- sandbox/trunk/2to3/lib2to3/fixes/fix_urllib.py (original)
+++ sandbox/trunk/2to3/lib2to3/fixes/fix_urllib.py Sun Aug 8 15:12:48 2010
@@ -142,7 +142,7 @@
names.extend([Name(elt, prefix=pref), Comma()])
names.append(Name(elts[-1], prefix=pref))
new = FromImport(module, names)
- if not first:
+ if not first or node.parent.prefix.endswith(indentation):
new.prefix = indentation
new_nodes.append(new)
first = False
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 Sun Aug 8 15:12:48 2010
@@ -1829,6 +1829,7 @@
from urllib.request import urlopen
"""
self.check(b, a)
+
b = """
def foo():
other()
@@ -1840,6 +1841,7 @@
from urllib.parse import urlencode
from urllib.request import urlopen
"""
+ self.check(b, a)
More information about the Python-checkins
mailing list