diff options
author | Thomi Richards <thomi.richards@canonical.com> | 2013-11-25 18:32:29 +1300 |
---|---|---|
committer | Thomi Richards <thomi.richards@canonical.com> | 2013-11-25 18:32:29 +1300 |
commit | 075c9e5d7e7a1fb96e19da7295238c08504ddb93 (patch) | |
tree | a3c6fa4d02b62feea95dd101ec0e1f87d6b63d9c /python/subunit/_output.py | |
parent | 62518e653d519f09d6d47c33ef66ee61590e8856 (diff) | |
download | subunit-git-075c9e5d7e7a1fb96e19da7295238c08504ddb93.tar.gz |
Read binary from stdin.
Diffstat (limited to 'python/subunit/_output.py')
-rw-r--r-- | python/subunit/_output.py | 5 |
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') |