[Python-checkins] cpython: test_hash: Fix a BytesWarning in get_hash_command()

victor.stinner python-checkins at python.org
Sat Feb 1 04:26:58 CET 2014


http://hg.python.org/cpython/rev/a29f05545ab5
changeset:   88880:a29f05545ab5
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Sat Feb 01 04:26:46 2014 +0100
summary:
  test_hash: Fix a BytesWarning in get_hash_command()

files:
  Lib/test/test_hash.py |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_hash.py b/Lib/test/test_hash.py
--- a/Lib/test/test_hash.py
+++ b/Lib/test/test_hash.py
@@ -172,7 +172,7 @@
     # an object to be tested
 
     def get_hash_command(self, repr_):
-        return 'print(hash(eval(%s.decode("utf-8"))))' % repr_.encode("utf-8")
+        return 'print(hash(eval(%r.decode("utf-8"))))' % repr_.encode("utf-8")
 
     def get_hash(self, repr_, seed=None):
         env = os.environ.copy()

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


More information about the Python-checkins mailing list