Fix #1848515 [Faile to compile translation file on 4.1.0](https://bugs.launchpad.net/calibre/+bug/1848515)

This commit is contained in:
Kovid Goyal 2019-10-17 19:51:32 +05:30
parent c0a9270f0f
commit ca1b3967b0
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -222,9 +222,11 @@ def make(filename, outfile):
# Compute output
output = generate()
try:
with open(outfile,"wb") as f:
if hasattr(outfile, 'write'):
outfile.write(output)
else:
with open(outfile, "wb") as f:
f.write(output)
except IOError as msg:
print(msg, file=sys.stderr)