diff options
| author | Thomi Richards <thomi.richards@canonical.com> | 2013-12-02 19:01:18 +1300 |
|---|---|---|
| committer | Thomi Richards <thomi.richards@canonical.com> | 2013-12-02 19:01:18 +1300 |
| commit | 098addd40f6e8176ef3b371916bf89272d0a61e4 (patch) | |
| tree | 9e06989c6ea91c27bf0a5b3d30f21621d5dffc29 /python | |
| parent | d89e45d46a28021669adf7f65ab6c985ca859189 (diff) | |
| download | subunit-git-098addd40f6e8176ef3b371916bf89272d0a61e4.tar.gz | |
Use make_stream_binary to turn stdin into a binary stream.
Diffstat (limited to 'python')
| -rw-r--r-- | python/subunit/_output.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/python/subunit/_output.py b/python/subunit/_output.py index af9dcad..6df6404 100644 --- a/python/subunit/_output.py +++ b/python/subunit/_output.py @@ -22,6 +22,7 @@ from optparse import ( ) import sys +from subunit import make_stream_binary from subunit.iso8601 import UTC from subunit.v2 import StreamResultToBytes @@ -131,10 +132,7 @@ def parse_arguments(args=None, ParserClass=OptionParser): if options.attach_file == '-': if not options.file_name: options.file_name = 'stdin' - if sys.version[0] >= '3': - options.attach_file = getattr(sys.stdin, 'buffer', sys.stdin) - else: - options.attach_file = sys.stdin + options.attach_file = make_stream_binary(sys.stdin) else: try: options.attach_file = open(options.attach_file, 'rb') |
