[Python-checkins] r83803 - sandbox/trunk/2to3/lib2to3/fixes/fix_urllib.py
benjamin.peterson
python-checkins at python.org
Sun Aug 8 02:05:08 CEST 2010
Author: benjamin.peterson
Date: Sun Aug 8 02:05:08 2010
New Revision: 83803
Log:
slightly more explicit
Modified:
sandbox/trunk/2to3/lib2to3/fixes/fix_urllib.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 02:05:08 2010
@@ -134,16 +134,18 @@
new_nodes = []
indentation = find_indentation(node)
- for i, module in enumerate(modules):
+ first = True
+ for module in modules:
elts = mod_dict[module]
names = []
for elt in elts[:-1]:
names.extend([Name(elt, prefix=pref), Comma()])
names.append(Name(elts[-1], prefix=pref))
new = FromImport(module, names)
- if i > 0:
+ if not first:
new.prefix = indentation
new_nodes.append(new)
+ first = False
if new_nodes:
nodes = []
for new_node in new_nodes[:-1]:
More information about the Python-checkins
mailing list