write to sys.stdout.buffer and fall back to sys.stdout

This commit is contained in:
josch 2015-02-16 19:20:06 +01:00
parent e810f3baf4
commit 4d005c8443

View file

@ -347,7 +347,7 @@ parser.add_argument(
nargs='+', help='input file(s)')
parser.add_argument(
'-o', '--output', metavar='out', type=argparse.FileType('wb'),
default=sys.stdout, help='output file (default: stdout)')
default=getattr(sys.stdout, "buffer", sys.stdout), help='output file (default: stdout)')
parser.add_argument(
'-d', '--dpi', metavar='dpi', type=positive_float,
help='dpi for pdf output (default: 96.0)')