diff options
author | Guido van Rossum <guido@python.org> | 2007-02-09 05:37:30 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-02-09 05:37:30 (GMT) |
commit | be19ed77ddb047e02fe94d142181062af6d99dcc (patch) | |
tree | 70f214e06554046fcccbadeb78665f25e07ce965 /Lib/test/sortperf.py | |
parent | 452bf519a70c3db0e7f0d2540b1bfb07d9085583 (diff) | |
download | cpython-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/sortperf.py')
-rw-r--r-- | Lib/test/sortperf.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/sortperf.py b/Lib/test/sortperf.py index 3c95b89..205ff87 100644 --- a/Lib/test/sortperf.py +++ b/Lib/test/sortperf.py @@ -38,7 +38,7 @@ def randfloats(n): except os.error: pass except IOError as msg: - print "can't write", fn, ":", msg + print("can't write", fn, ":", msg) else: result = marshal.load(fp) fp.close() @@ -60,7 +60,7 @@ def doit(L): t0 = time.clock() L.sort() t1 = time.clock() - print "%6.2f" % (t1-t0), + print("%6.2f" % (t1-t0), end=' ') flush() def tabulate(r): @@ -84,11 +84,11 @@ def tabulate(r): """ cases = tuple([ch + "sort" for ch in r"*\/3+%~=!"]) fmt = ("%2s %7s" + " %6s"*len(cases)) - print fmt % (("i", "2**i") + cases) + print(fmt % (("i", "2**i") + cases)) for i in r: n = 1 << i L = randfloats(n) - print "%2d %7d" % (i, n), + print("%2d %7d" % (i, n), end=' ') flush() doit(L) # *sort L.reverse() @@ -137,7 +137,7 @@ def tabulate(r): # significantly faster if we leave tham as ints. L = map(float, L) doit(L) # !sort - print + print() def main(): """Main program when invoked as a script. |