summaryrefslogtreecommitdiffstats
path: root/Tools/scripts/hotshotmain.py
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/scripts/hotshotmain.py')
-rw-r--r--Tools/scripts/hotshotmain.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Tools/scripts/hotshotmain.py b/Tools/scripts/hotshotmain.py
index 4f40628..7e39d98 100644
--- a/Tools/scripts/hotshotmain.py
+++ b/Tools/scripts/hotshotmain.py
@@ -23,7 +23,12 @@ def run_hotshot(filename, profile, args):
prof = hotshot.Profile(profile)
sys.path.insert(0, os.path.dirname(filename))
sys.argv = [filename] + args
- prof.run("execfile(%r)" % filename)
+ fp = open(filename)
+ try:
+ script = fp.read()
+ finally:
+ fp.close()
+ prof.run("exec(%r)" % script)
prof.close()
stats = hotshot.stats.load(profile)
stats.sort_stats("time", "calls")