summaryrefslogtreecommitdiffstats
path: root/Lib/profile.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-05-04 05:17:47 (GMT)
committerGitHub <noreply@github.com>2017-05-04 05:17:47 (GMT)
commit7e4db2f253c555568d56177c2fd083bcf8f88d34 (patch)
treeaa2606f09d5b1095bb20573ed6b0be38ca4d6f33 /Lib/profile.py
parent1c4670ea0cc3d208121af11b9b973e6bb268e570 (diff)
downloadcpython-7e4db2f253c555568d56177c2fd083bcf8f88d34.zip
cpython-7e4db2f253c555568d56177c2fd083bcf8f88d34.tar.gz
cpython-7e4db2f253c555568d56177c2fd083bcf8f88d34.tar.bz2
bpo-30166: Import command-line parsing modules only when needed. (#1293)
Diffstat (limited to 'Lib/profile.py')
-rwxr-xr-xLib/profile.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/profile.py b/Lib/profile.py
index 5d0e968..5ceeddc 100755
--- a/Lib/profile.py
+++ b/Lib/profile.py
@@ -25,10 +25,8 @@
import sys
-import os
import time
import marshal
-from optparse import OptionParser
__all__ = ["run", "runctx", "Profile"]
@@ -179,7 +177,7 @@ class Profile:
self.t = self.get_time()
self.simulate_call('profiler')
- # Heavily optimized dispatch routine for os.times() timer
+ # Heavily optimized dispatch routine for time.process_time() timer
def trace_dispatch(self, frame, event, arg):
timer = self.timer
@@ -552,6 +550,9 @@ class Profile:
#****************************************************************************
def main():
+ import os
+ from optparse import OptionParser
+
usage = "profile.py [-o output_file_path] [-s sort] scriptfile [arg] ..."
parser = OptionParser(usage=usage)
parser.allow_interspersed_args = False