summaryrefslogtreecommitdiffstats
path: root/Lib/test/time_hashlib.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-02-09 05:37:30 (GMT)
committerGuido van Rossum <guido@python.org>2007-02-09 05:37:30 (GMT)
commitbe19ed77ddb047e02fe94d142181062af6d99dcc (patch)
tree70f214e06554046fcccbadeb78665f25e07ce965 /Lib/test/time_hashlib.py
parent452bf519a70c3db0e7f0d2540b1bfb07d9085583 (diff)
downloadcpython-be19ed77ddb047e02fe94d142181062af6d99dcc.zip
cpython-be19ed77ddb047e02fe94d142181062af6d99dcc.tar.gz
cpython-be19ed77ddb047e02fe94d142181062af6d99dcc.tar.bz2
Fix most trivially-findable print statements.
There's one major and one minor category still unfixed: doctests are the major category (and I hope to be able to augment the refactoring tool to refactor bona fide doctests soon); other code generating print statements in strings is the minor category. (Oh, and I don't know if the compiler package works.)
Diffstat (limited to 'Lib/test/time_hashlib.py')
-rw-r--r--Lib/test/time_hashlib.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/Lib/test/time_hashlib.py b/Lib/test/time_hashlib.py
index de25cfd..c210bd2 100644
--- a/Lib/test/time_hashlib.py
+++ b/Lib/test/time_hashlib.py
@@ -18,7 +18,7 @@ def test_scaled_msg(scale, name):
x = localCF(longStr).digest()
end = time.time()
- print ('%2.2f' % (end-start)), "seconds", iterations, "x", len(longStr), "bytes", name
+ print(('%2.2f' % (end-start)), "seconds", iterations, "x", len(longStr), "bytes", name)
def test_create():
start = time.time()
@@ -26,7 +26,7 @@ def test_create():
d = creatorFunc()
end = time.time()
- print ('%2.2f' % (end-start)), "seconds", '[20000 creations]'
+ print(('%2.2f' % (end-start)), "seconds", '[20000 creations]')
def test_zero():
start = time.time()
@@ -34,7 +34,7 @@ def test_zero():
x = creatorFunc().digest()
end = time.time()
- print ('%2.2f' % (end-start)), "seconds", '[20000 "" digests]'
+ print(('%2.2f' % (end-start)), "seconds", '[20000 "" digests]')
@@ -46,33 +46,33 @@ hName = sys.argv[1]
if hName in ('_md5', '_sha'):
exec('import '+hName)
exec('creatorFunc = '+hName+'.new')
- print "testing speed of old", hName, "legacy interface"
+ print("testing speed of old", hName, "legacy interface")
elif hName == '_hashlib' and len(sys.argv) > 3:
import _hashlib
exec('creatorFunc = _hashlib.%s' % sys.argv[2])
- print "testing speed of _hashlib.%s" % sys.argv[2], getattr(_hashlib, sys.argv[2])
+ print("testing speed of _hashlib.%s" % sys.argv[2], getattr(_hashlib, sys.argv[2]))
elif hName == '_hashlib' and len(sys.argv) == 3:
import _hashlib
exec('creatorFunc = lambda x=_hashlib.new : x(%r)' % sys.argv[2])
- print "testing speed of _hashlib.new(%r)" % sys.argv[2]
+ print("testing speed of _hashlib.new(%r)" % sys.argv[2])
elif hasattr(hashlib, hName) and callable(getattr(hashlib, hName)):
creatorFunc = getattr(hashlib, hName)
- print "testing speed of hashlib."+hName, getattr(hashlib, hName)
+ print("testing speed of hashlib."+hName, getattr(hashlib, hName))
else:
exec("creatorFunc = lambda x=hashlib.new : x(%r)" % hName)
- print "testing speed of hashlib.new(%r)" % hName
+ print("testing speed of hashlib.new(%r)" % hName)
try:
test_create()
except ValueError:
- print
- print "pass argument(s) naming the hash to run a speed test on:"
- print " '_md5' and '_sha' test the legacy builtin md5 and sha"
- print " '_hashlib' 'openssl_hName' 'fast' tests the builtin _hashlib"
- print " '_hashlib' 'hName' tests builtin _hashlib.new(shaFOO)"
- print " 'hName' tests the hashlib.hName() implementation if it exists"
- print " otherwise it uses hashlib.new(hName)."
- print
+ print()
+ print("pass argument(s) naming the hash to run a speed test on:")
+ print(" '_md5' and '_sha' test the legacy builtin md5 and sha")
+ print(" '_hashlib' 'openssl_hName' 'fast' tests the builtin _hashlib")
+ print(" '_hashlib' 'hName' tests builtin _hashlib.new(shaFOO)")
+ print(" 'hName' tests the hashlib.hName() implementation if it exists")
+ print(" otherwise it uses hashlib.new(hName).")
+ print()
raise
test_zero()