[Python-checkins] cpython (3.4): fix issue23157 - time_hashlib hadn't been ported to Python 3.

gregory.p.smith python-checkins at python.org
Sun Jan 4 09:37:21 CET 2015


https://hg.python.org/cpython/rev/badb7e319ed0
changeset:   94014:badb7e319ed0
branch:      3.4
parent:      94008:26e1b78448f9
user:        Gregory P. Smith <greg at krypto.org>
date:        Sun Jan 04 00:36:04 2015 -0800
summary:
  fix issue23157 - time_hashlib hadn't been ported to Python 3.

files:
  Lib/test/time_hashlib.py |  7 ++++---
  1 files changed, 4 insertions(+), 3 deletions(-)


diff --git a/Lib/test/time_hashlib.py b/Lib/test/time_hashlib.py
--- a/Lib/test/time_hashlib.py
+++ b/Lib/test/time_hashlib.py
@@ -1,7 +1,8 @@
 # It's intended that this script be run by hand.  It runs speed tests on
 # hashlib functions; it does not test for correctness.
 
-import sys, time
+import sys
+import time
 import hashlib
 
 
@@ -9,8 +10,8 @@
     raise RuntimeError("eek, creatorFunc not overridden")
 
 def test_scaled_msg(scale, name):
-    iterations = 106201/scale * 20
-    longStr = 'Z'*scale
+    iterations = 106201//scale * 20
+    longStr = b'Z'*scale
 
     localCF = creatorFunc
     start = time.time()

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


More information about the Python-checkins mailing list