[Python-checkins] r73957 - in sandbox/trunk/2to3/lib2to3: refactor.py tests/data/different_encoding.py

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


Author: benjamin.peterson
Date: Sat Jul 11 22:49:56 2009
New Revision: 73957

Log:
fix a calls to str() with unicode()

Modified:
   sandbox/trunk/2to3/lib2to3/refactor.py
   sandbox/trunk/2to3/lib2to3/tests/data/different_encoding.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:49:56 2009
@@ -343,7 +343,7 @@
                 if results:
                     new = fixer.transform(node, results)
                     if new is not None and (new != node or
-                                            str(new) != str(node)):
+                                            unicode(new) != unicode(node)):
                         node.replace(new)
                         node = new
 

Modified: sandbox/trunk/2to3/lib2to3/tests/data/different_encoding.py
==============================================================================
--- sandbox/trunk/2to3/lib2to3/tests/data/different_encoding.py	(original)
+++ sandbox/trunk/2to3/lib2to3/tests/data/different_encoding.py	Sat Jul 11 22:49:56 2009
@@ -1,3 +1,6 @@
 #!/usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-print u'ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ'
+# -*- coding: utf-8 -*-
+print u'ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ'
+
+def f(x):
+    print '%s\t->  α(%2i):%s  β(%s)'


More information about the Python-checkins mailing list