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/profile.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/profile.py')
-rwxr-xr-x | Lib/profile.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/profile.py b/Lib/profile.py index dc278dd..83480cf 100755 --- a/Lib/profile.py +++ b/Lib/profile.py @@ -94,8 +94,8 @@ def runctx(statement, globals, locals, filename=None): # Backwards compatibility. def help(): - print "Documentation for the profile module can be found " - print "in the Python Library Reference, section 'The Python Profiler'." + print("Documentation for the profile module can be found ") + print("in the Python Library Reference, section 'The Python Profiler'.") if os.name == "mac": import MacOS @@ -550,7 +550,7 @@ class Profile: t1 = get_time() elapsed_noprofile = t1 - t0 if verbose: - print "elapsed time without profiling =", elapsed_noprofile + print("elapsed time without profiling =", elapsed_noprofile) # elapsed_profile <- time f(m) takes with profiling. The difference # is profiling overhead, only some of which the profiler subtracts @@ -561,7 +561,7 @@ class Profile: t1 = get_time() elapsed_profile = t1 - t0 if verbose: - print "elapsed time with profiling =", elapsed_profile + print("elapsed time with profiling =", elapsed_profile) # reported_time <- "CPU seconds" the profiler charged to f and f1. total_calls = 0.0 @@ -573,8 +573,8 @@ class Profile: reported_time += tt if verbose: - print "'CPU seconds' profiler reported =", reported_time - print "total # calls =", total_calls + print("'CPU seconds' profiler reported =", reported_time) + print("total # calls =", total_calls) if total_calls != m + 1: raise ValueError("internal error: total calls = %d" % total_calls) @@ -584,12 +584,12 @@ class Profile: # overhead per event. mean = (reported_time - elapsed_noprofile) / 2.0 / total_calls if verbose: - print "mean stopwatch overhead per profile event =", mean + print("mean stopwatch overhead per profile event =", mean) return mean #**************************************************************************** def Stats(*args): - print 'Report generating functions are in the "pstats" module\a' + print('Report generating functions are in the "pstats" module\a') def main(): usage = "profile.py [-o output_file_path] [-s sort] scriptfile [arg] ..." |