Commit 776c0df4 authored by R David Murray's avatar R David Murray

#14508: make gprof2html script runnable under python3

Not that I haven't tested it to make sure it works, just that it
can run against an empty source file.

Initial patch by Popa.Claudiu.
parent d70846b1
......@@ -19,17 +19,19 @@ trailer = """\
</html>
"""
def add_escapes(input):
for line in input:
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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment