summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomi Richards <thomi.richards@canonical.com>2013-11-25 18:32:29 +1300
committerThomi Richards <thomi.richards@canonical.com>2013-11-25 18:32:29 +1300
commit89acb22a7b22de233d953842949ca22e951a6931 (patch)
treea3c6fa4d02b62feea95dd101ec0e1f87d6b63d9c
parent8ee031da94894c8249ba79a5f20442def5944699 (diff)
downloadsubunit-89acb22a7b22de233d953842949ca22e951a6931.tar.gz
Read binary from stdin.
-rw-r--r--python/subunit/_output.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/python/subunit/_output.py b/python/subunit/_output.py
index 8be2ca8..0a1ef5d 100644
--- a/python/subunit/_output.py
+++ b/python/subunit/_output.py
@@ -131,7 +131,10 @@ def parse_arguments(args=None, ParserClass=OptionParser):
if options.attach_file == '-':
if not options.file_name:
options.file_name = 'stdin'
- options.attach_file = sys.stdin
+ if sys.version[0] >= '3':
+ options.attach_file = sys.stdin.buffer
+ else:
+ options.attach_file = sys.stdin
else:
try:
options.attach_file = open(options.attach_file, 'rb')