There was an error while loading. Please reload this page.
1 parent 06ca3f0 commit a692efeCopy full SHA for a692efe
1 file changed
Tools/i18n/msgfmt.py
@@ -89,7 +89,7 @@ def generate():
89
7*4, # start of key index
90
7*4+len(keys)*8, # start of value index
91
0, 0) # size and offset of hash table
92
- output += array.array("i", offsets).tostring()
+ output += array.array("i", offsets).tobytes()
93
output += ids
94
output += strs
95
return output
@@ -109,7 +109,8 @@ def make(filename, outfile):
109
outfile = os.path.splitext(infile)[0] + '.mo'
110
111
try:
112
- lines = open(infile, 'rb').readlines()
+ with open(infile, 'rb') as f:
113
+ lines = f.readlines()
114
except IOError as msg:
115
print(msg, file=sys.stderr)
116
sys.exit(1)
@@ -199,7 +200,8 @@ def make(filename, outfile):
199
200
output = generate()
201
202
- open(outfile,"wb").write(output)
203
+ with open(outfile,"wb") as f:
204
+ f.write(output)
205
206
207
0 commit comments