Commit b99d8d8e authored by Vincent Pelletier's avatar Vincent Pelletier

Wrap stdout into a StreamWriter instance.

parent 61598f8f
......@@ -1516,7 +1516,7 @@ def main():
end_parsing_time = time.time()
generator, out_encoding = format_generator[args.format]
if args.out == '-':
out = sys.stdout
out = codecs.getwriter(out_encoding)(sys.stdout)
else:
out = codecs.open(args.out, 'w', encoding=out_encoding)
with out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment