]> granicus.if.org Git - python/commitdiff
Merged revisions 77855-77856,77870 via svnmerge from
authorMartin v. Löwis <martin@v.loewis.de>
Mon, 1 Feb 2010 01:15:39 +0000 (01:15 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Mon, 1 Feb 2010 01:15:39 +0000 (01:15 +0000)
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

........
  r77855 | benjamin.peterson | 2010-01-30 17:32:05 +0100 (Sa, 30 Jan 2010) | 1 line

  don't return node if it is not changed
........
  r77856 | benjamin.peterson | 2010-01-30 17:35:29 +0100 (Sa, 30 Jan 2010) | 1 line

  return None to indicate no change
........
  r77870 | benjamin.peterson | 2010-01-31 02:21:26 +0100 (So, 31 Jan 2010) | 1 line

  never return the original node given to transform()
........

Lib/lib2to3/fixes/fix_import.py
Lib/lib2to3/fixes/fix_itertools_imports.py
Lib/lib2to3/fixes/fix_metaclass.py
Lib/lib2to3/fixes/fix_tuple_params.py
Lib/lib2to3/fixes/fix_xrange.py

index e2bd8e7192f207ac3bc5341054985b3cf09953a5..8c81ff8b82068bd0a790849746e01207f22f6be0 100644 (file)
@@ -56,7 +56,6 @@ class FixImport(fixer_base.BaseFix):
             if self.probably_a_local_import(imp.value):
                 imp.value = u"." + imp.value
                 imp.changed()
-                return node
         else:
             have_local = False
             have_absolute = False
index ab43dcdd02de6b3f3c5d55920f533a3c367e7f32..c7223de747212eb905fa13810eae0fe2999fec8e 100644 (file)
@@ -49,4 +49,4 @@ class FixItertoolsImports(fixer_base.BaseFix):
             p = node.prefix
             node = BlankLine()
             node.prefix = p
-        return node
+            return node
index ed8e5d51ed8620417efdab48879f319db4b77868..789cb168bbc36a8486bf36ccc3f54ab14cb3acb6 100644 (file)
@@ -150,7 +150,7 @@ class FixMetaclass(fixer_base.BaseFix):
 
     def transform(self, node, results):
         if not has_metaclass(node):
-            return node
+            return
 
         fixup_parse_tree(node)
 
index b82f4339041c1d143c3ae91a450f1dde016ad40a..2876a67af3500e63a2f7424fdc4afd92f671ba02 100644 (file)
@@ -81,7 +81,7 @@ class FixTupleParams(fixer_base.BaseFix):
                     handle_tuple(arg, add_prefix=(i > 0))
 
         if not new_lines:
-            return node
+            return
 
         # This isn't strictly necessary, but it plays nicely with other fixers.
         # TODO(cwinter) get rid of this when children becomes a smart list
index ad910a71553ea3e63a8710f76a41ba0d91e42ecd..70c674719c2380a828115dcd55e3ed957165e6a3 100644 (file)
@@ -40,7 +40,6 @@ class FixXrange(fixer_base.BaseFix):
             for n in results["rest"]:
                 list_call.append_child(n)
             return list_call
-        return node
 
     P1 = "power< func=NAME trailer< '(' node=any ')' > any* >"
     p1 = patcomp.compile_pattern(P1)