summaryrefslogtreecommitdiff
path: root/Lib/timeit.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-02-09 05:37:30 +0000
committerGuido van Rossum <guido@python.org>2007-02-09 05:37:30 +0000
commitbe19ed77ddb047e02fe94d142181062af6d99dcc (patch)
tree70f214e06554046fcccbadeb78665f25e07ce965 /Lib/timeit.py
parent452bf519a70c3db0e7f0d2540b1bfb07d9085583 (diff)
downloadcpython-git-be19ed77ddb047e02fe94d142181062af6d99dcc.tar.gz
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/timeit.py')
-rw-r--r--Lib/timeit.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/Lib/timeit.py b/Lib/timeit.py
index 5dd3ca9249..e760c62353 100644
--- a/Lib/timeit.py
+++ b/Lib/timeit.py
@@ -210,8 +210,8 @@ def main(args=None):
["number=", "setup=", "repeat=",
"time", "clock", "verbose", "help"])
except getopt.error as err:
- print err
- print "use -h/--help for command line help"
+ print(err)
+ print("use -h/--help for command line help")
return 2
timer = default_timer
stmt = "\n".join(args) or "pass"
@@ -238,7 +238,7 @@ def main(args=None):
precision += 1
verbose += 1
if o in ("-h", "--help"):
- print __doc__,
+ print(__doc__, end=' ')
return 0
setup = "\n".join(setup) or "pass"
# Include the current directory, so that local imports work (sys.path
@@ -257,7 +257,7 @@ def main(args=None):
t.print_exc()
return 1
if verbose:
- print "%d loops -> %.*g secs" % (number, precision, x)
+ print("%d loops -> %.*g secs" % (number, precision, x))
if x >= 0.2:
break
try:
@@ -267,18 +267,18 @@ def main(args=None):
return 1
best = min(r)
if verbose:
- print "raw times:", " ".join(["%.*g" % (precision, x) for x in r])
- print "%d loops," % number,
+ print("raw times:", " ".join(["%.*g" % (precision, x) for x in r]))
+ print("%d loops," % number, end=' ')
usec = best * 1e6 / number
if usec < 1000:
- print "best of %d: %.*g usec per loop" % (repeat, precision, usec)
+ print("best of %d: %.*g usec per loop" % (repeat, precision, usec))
else:
msec = usec / 1000
if msec < 1000:
- print "best of %d: %.*g msec per loop" % (repeat, precision, msec)
+ print("best of %d: %.*g msec per loop" % (repeat, precision, msec))
else:
sec = msec / 1000
- print "best of %d: %.*g sec per loop" % (repeat, precision, sec)
+ print("best of %d: %.*g sec per loop" % (repeat, precision, sec))
return None
if __name__ == "__main__":