summaryrefslogtreecommitdiffstats
path: root/Lib/profile.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/profile.py')
-rwxr-xr-xLib/profile.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/profile.py b/Lib/profile.py
index 55118b5..cdc2479 100755
--- a/Lib/profile.py
+++ b/Lib/profile.py
@@ -609,7 +609,12 @@ def main():
if (len(sys.argv) > 0):
sys.path.insert(0, os.path.dirname(sys.argv[0]))
- run('execfile(%r)' % (sys.argv[0],), options.outfile, options.sort)
+ fp = open(sys.argv[0])
+ try:
+ script = fp.read()
+ finally:
+ fp.close()
+ run('exec(%r)' % script, options.outfile, options.sort)
else:
parser.print_usage()
return parser