Fix the listing/map output to be Python 3 compatible

This commit is contained in:
Michael Martin 2019-04-12 20:47:01 -07:00
parent 41bf01d035
commit 99f074da27

View File

@ -40,7 +40,7 @@ class Listing(object):
if self.filename == "-":
out = sys.stdout
else:
out = file(self.filename, "w")
out = open(self.filename, "wt")
for x in self.listing:
if type(x) is str:
print(x, file=out)
@ -118,7 +118,7 @@ class LabelMapper(object):
if self.filename == "-":
out = sys.stdout
else:
out = file(self.filename, "w")
out = open(self.filename, "wt")
maxlabellen = 0
self.labeldata.sort()
for (loc, label, srcloc) in self.labeldata: