[Python-checkins] cpython (3.2): #17217: fix UnicodeEncodeErrors errors in test_format by printing ASCII only.

ezio.melotti python-checkins at python.org
Sat Feb 23 06:58:44 CET 2013


http://hg.python.org/cpython/rev/831be7dc260a
changeset:   82333:831be7dc260a
branch:      3.2
parent:      82330:01fdf24c9d75
user:        Ezio Melotti <ezio.melotti at gmail.com>
date:        Sat Feb 23 07:53:56 2013 +0200
summary:
  #17217: fix UnicodeEncodeErrors errors in test_format by printing ASCII only.

files:
  Lib/test/test_format.py |  6 +++---
  1 files changed, 3 insertions(+), 3 deletions(-)


diff --git a/Lib/test/test_format.py b/Lib/test/test_format.py
--- a/Lib/test/test_format.py
+++ b/Lib/test/test_format.py
@@ -13,10 +13,10 @@
 def testformat(formatstr, args, output=None, limit=None, overflowok=False):
     if verbose:
         if output:
-            print("%r %% %r =? %r ..." %\
-                (formatstr, args, output), end=' ')
+            print("{!a} % {!a} =? {!a} ...".format(formatstr, args, output),
+                  end=' ')
         else:
-            print("%r %% %r works? ..." % (formatstr, args), end=' ')
+            print("{!a} % {!a} works? ...".format(formatstr, args), end=' ')
     try:
         result = formatstr % args
     except OverflowError:

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list