cli: simplify stdin/stdout logic

This commit is contained in:
Roman Zeyde
2015-01-20 10:19:45 +02:00
parent 33385b294e
commit 5275f25d14

View File

@@ -7,12 +7,10 @@ import zlib
import logging
import argparse
if sys.version_info.major == 2:
_stdin = sys.stdin
_stdout = sys.stdout
else:
_stdin = sys.stdin.buffer
_stdout = sys.stdout.buffer
# Python 3 has `buffer` attribute for byte-based I/O
_stdin = getattr(sys.stdin, 'buffer', sys.stdin)
_stdout = getattr(sys.stdout, 'buffer', sys.stdout)
try:
import argcomplete