[Python-checkins] r55000 - sandbox/trunk/2to3/refactor.py

guido.van.rossum python-checkins at python.org
Fri Apr 27 18:46:00 CEST 2007


Author: guido.van.rossum
Date: Fri Apr 27 18:45:58 2007
New Revision: 55000

Modified:
   sandbox/trunk/2to3/refactor.py
Log:
After replacing 'node' with 'new' in the tree, also move 'new' into the local
variable 'node', so a second firing transformation won't hit an assertion.


Modified: sandbox/trunk/2to3/refactor.py
==============================================================================
--- sandbox/trunk/2to3/refactor.py	(original)
+++ sandbox/trunk/2to3/refactor.py	Fri Apr 27 18:45:58 2007
@@ -259,6 +259,7 @@
                     if new is not None and (new != node or
                                             str(new) != str(node)):
                         node.replace(new)
+                        node = new
                         changes += 1
                     elif tree.was_changed:
                         changes += 1


More information about the Python-checkins mailing list