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

benjamin.peterson python-checkins at python.org
Sat Jul 11 22:51:51 CEST 2009


Author: benjamin.peterson
Date: Sat Jul 11 22:51:51 2009
New Revision: 73958

Log:
more str() -> unicode()

Modified:
   sandbox/trunk/2to3/lib2to3/refactor.py

Modified: sandbox/trunk/2to3/lib2to3/refactor.py
==============================================================================
--- sandbox/trunk/2to3/lib2to3/refactor.py	(original)
+++ sandbox/trunk/2to3/lib2to3/refactor.py	Sat Jul 11 22:51:51 2009
@@ -298,7 +298,7 @@
         else:
             tree = self.refactor_string(input, "<stdin>")
             if tree and tree.was_changed:
-                self.processed_file(str(tree), "<stdin>", input)
+                self.processed_file(unicode(tree), "<stdin>", input)
             else:
                 self.log_debug("No changes in stdin")
 
@@ -452,7 +452,7 @@
                            filename, lineno, err.__class__.__name__, err)
             return block
         if self.refactor_tree(tree, filename):
-            new = str(tree).splitlines(True)
+            new = unicode(tree).splitlines(True)
             # Undo the adjustment of the line numbers in wrap_toks() below.
             clipped, new = new[:lineno-1], new[lineno-1:]
             assert clipped == [u"\n"] * (lineno-1), clipped


More information about the Python-checkins mailing list