[Python-checkins] r77898 - in python/trunk/Lib/lib2to3: fixes/fix_import.py fixes/fix_itertools_imports.py fixes/fix_metaclass.py fixes/fix_tuple_params.py fixes/fix_xrange.py

martin.v.loewis python-checkins at python.org
Mon Feb 1 02:15:40 CET 2010


Author: martin.v.loewis
Date: Mon Feb  1 02:15:39 2010
New Revision: 77898

Log:
Merged revisions 77855-77856,77870 via svnmerge from 
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()
........


Modified:
   python/trunk/Lib/lib2to3/   (props changed)
   python/trunk/Lib/lib2to3/fixes/fix_import.py
   python/trunk/Lib/lib2to3/fixes/fix_itertools_imports.py
   python/trunk/Lib/lib2to3/fixes/fix_metaclass.py
   python/trunk/Lib/lib2to3/fixes/fix_tuple_params.py
   python/trunk/Lib/lib2to3/fixes/fix_xrange.py

Modified: python/trunk/Lib/lib2to3/fixes/fix_import.py
==============================================================================
--- python/trunk/Lib/lib2to3/fixes/fix_import.py	(original)
+++ python/trunk/Lib/lib2to3/fixes/fix_import.py	Mon Feb  1 02:15:39 2010
@@ -56,7 +56,6 @@
             if self.probably_a_local_import(imp.value):
                 imp.value = u"." + imp.value
                 imp.changed()
-                return node
         else:
             have_local = False
             have_absolute = False

Modified: python/trunk/Lib/lib2to3/fixes/fix_itertools_imports.py
==============================================================================
--- python/trunk/Lib/lib2to3/fixes/fix_itertools_imports.py	(original)
+++ python/trunk/Lib/lib2to3/fixes/fix_itertools_imports.py	Mon Feb  1 02:15:39 2010
@@ -49,4 +49,4 @@
             p = node.prefix
             node = BlankLine()
             node.prefix = p
-        return node
+            return node

Modified: python/trunk/Lib/lib2to3/fixes/fix_metaclass.py
==============================================================================
--- python/trunk/Lib/lib2to3/fixes/fix_metaclass.py	(original)
+++ python/trunk/Lib/lib2to3/fixes/fix_metaclass.py	Mon Feb  1 02:15:39 2010
@@ -150,7 +150,7 @@
 
     def transform(self, node, results):
         if not has_metaclass(node):
-            return node
+            return
 
         fixup_parse_tree(node)
 

Modified: python/trunk/Lib/lib2to3/fixes/fix_tuple_params.py
==============================================================================
--- python/trunk/Lib/lib2to3/fixes/fix_tuple_params.py	(original)
+++ python/trunk/Lib/lib2to3/fixes/fix_tuple_params.py	Mon Feb  1 02:15:39 2010
@@ -81,7 +81,7 @@
                     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

Modified: python/trunk/Lib/lib2to3/fixes/fix_xrange.py
==============================================================================
--- python/trunk/Lib/lib2to3/fixes/fix_xrange.py	(original)
+++ python/trunk/Lib/lib2to3/fixes/fix_xrange.py	Mon Feb  1 02:15:39 2010
@@ -40,7 +40,6 @@
             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)


More information about the Python-checkins mailing list