diff options
Diffstat (limited to 'Lib/profile.py')
-rwxr-xr-x | Lib/profile.py | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/Lib/profile.py b/Lib/profile.py index 67d61b6331..297e32d64a 100755 --- a/Lib/profile.py +++ b/Lib/profile.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 # # Class for profiling python code. rev 1.0 6/2/94 # @@ -10,13 +10,13 @@ # Copyright Disney Enterprises, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement -# +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, @@ -30,7 +30,7 @@ import time import marshal from optparse import OptionParser -__all__ = ["run", "runctx", "help", "Profile"] +__all__ = ["run", "runctx", "Profile"] # Sample timer for use with #i_count = 0 @@ -83,16 +83,6 @@ def runctx(statement, globals, locals, filename=None, sort=-1): else: return prof.print_stats(sort) -# Backwards compatibility. -def help(): - 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 - def _get_time_mac(timer=MacOS.GetTicks): - return timer() / 60.0 - if hasattr(os, "times"): def _get_time_times(timer=os.times): t = timer() @@ -169,10 +159,6 @@ class Profile: self.timer = resgetrusage self.dispatcher = self.trace_dispatch self.get_time = _get_time_resource - elif os.name == 'mac': - self.timer = MacOS.GetTicks - self.dispatcher = self.trace_dispatch_mac - self.get_time = _get_time_mac elif hasattr(time, 'clock'): self.timer = self.get_time = time.clock self.dispatcher = self.trace_dispatch_i @@ -579,8 +565,6 @@ class Profile: return mean #**************************************************************************** -def Stats(*args): - print('Report generating functions are in the "pstats" module\a') def main(): usage = "profile.py [-o output_file_path] [-s sort] scriptfile [arg] ..." |