summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/scripts/gprof2html.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/Tools/scripts/gprof2html.py b/Tools/scripts/gprof2html.py
index f3c7202..6c899d9 100755
--- a/Tools/scripts/gprof2html.py
+++ b/Tools/scripts/gprof2html.py
@@ -19,17 +19,19 @@ trailer = """\
</html>
"""
-def add_escapes(input):
- for line in input:
- yield cgi.escape(line)
+def add_escapes(filename):
+ with open(filename) as fp:
+ for line in fp:
+ yield cgi.escape(line)
+
def main():
filename = "gprof.out"
if sys.argv[1:]:
filename = sys.argv[1]
outputfilename = filename + ".html"
- input = add_escapes(file(filename))
- output = file(outputfilename, "w")
+ input = add_escapes(filename)
+ output = open(outputfilename, "w")
output.write(header % filename)
for line in input:
output.write(line)