From be19ed77ddb047e02fe94d142181062af6d99dcc Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 9 Feb 2007 05:37:30 +0000 Subject: 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.) --- Lib/test/time_hashlib.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'Lib/test/time_hashlib.py') diff --git a/Lib/test/time_hashlib.py b/Lib/test/time_hashlib.py index de25cfd391..c210bd22aa 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() -- cgit v1.2.1