[ttLib] don't close stdout in TTFont.saveXML()

otherwise when dumping multiple TTX to standard output it raises:

ValueError: I/O operation on closed file
This commit is contained in:
Cosimo Lupo 2017-01-18 12:06:46 +00:00
parent ff247f9be4
commit 63f5253ec7
No known key found for this signature in database
GPG Key ID: B61AAAD0B53A6419

View File

@ -314,8 +314,9 @@ class TTFont(object):
progress.set((i + 1))
writer.endtag("ttFont")
writer.newline()
# close if 'fileOrPath' is a path; leave it open if it's a file
if not hasattr(fileOrPath, "write"):
# close if 'fileOrPath' is a path; leave it open if it's a file.
# The special string "-" means standard output so leave that open too
if not hasattr(fileOrPath, "write") and fileOrPath != "-":
writer.close()
def _tableToXML(self, writer, tag, progress, quiet=None):