mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1848515 [Faile to compile translation file on 4.1.0](https://bugs.launchpad.net/calibre/+bug/1848515)
This commit is contained in:
parent
c0a9270f0f
commit
ca1b3967b0
@ -222,10 +222,12 @@ def make(filename, outfile):
|
||||
|
||||
# Compute output
|
||||
output = generate()
|
||||
|
||||
try:
|
||||
with open(outfile,"wb") as f:
|
||||
f.write(output)
|
||||
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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user