summaryrefslogtreecommitdiffstats
path: root/Lib/cProfile.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/cProfile.py')
-rwxr-xr-xLib/cProfile.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/Lib/cProfile.py b/Lib/cProfile.py
index b2efd04..c24d45b 100755
--- a/Lib/cProfile.py
+++ b/Lib/cProfile.py
@@ -1,10 +1,10 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""Python interface for the 'lsprof' profiler.
Compatible with the 'profile' module.
"""
-__all__ = ["run", "runctx", "help", "Profile"]
+__all__ = ["run", "runctx", "Profile"]
import _lsprof
@@ -56,11 +56,6 @@ def runctx(statement, globals, locals, filename=None, sort=-1):
result = prof.print_stats(sort)
return result
-# Backwards compatibility.
-def help():
- print "Documentation for the profile/cProfile modules can be found "
- print "in the Python Library Reference, section 'The Python Profiler'."
-
# ____________________________________________________________
class Profile(_lsprof.Profiler):
@@ -137,7 +132,7 @@ class Profile(_lsprof.Profiler):
def runctx(self, cmd, globals, locals):
self.enable()
try:
- exec cmd in globals, locals
+ exec(cmd, globals, locals)
finally:
self.disable()
return self
@@ -188,6 +183,7 @@ def main():
'__file__': progname,
'__name__': '__main__',
'__package__': None,
+ '__cached__': None,
}
runctx(code, globs, None, options.outfile, options.sort)
else: