diff options
| author | Robert Collins <robertc@robertcollins.net> | 2013-01-27 13:55:33 +1300 |
|---|---|---|
| committer | Robert Collins <robertc@robertcollins.net> | 2013-01-27 13:55:33 +1300 |
| commit | b30eef80f028c8d156ed9a30e82f393121cfb7a9 (patch) | |
| tree | f3dd99039154d3c933b2e5a3aad64fd9474b1ce3 /python/subunit/__init__.py | |
| parent | 84768c10f4dfa67ab5d299814e7caa3d30ed38da (diff) | |
| download | subunit-b30eef80f028c8d156ed9a30e82f393121cfb7a9.tar.gz | |
Tweak Python3 support to help testrepository get 3-ready.
Diffstat (limited to 'python/subunit/__init__.py')
| -rw-r--r-- | python/subunit/__init__.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py index 42dcf29..dfc5e94 100644 --- a/python/subunit/__init__.py +++ b/python/subunit/__init__.py @@ -121,9 +121,9 @@ import re import subprocess import sys import unittest -if sys.version_info > (3, 0): +try: from io import UnsupportedOperation as _UnsupportedOperation -else: +except ImportError: _UnsupportedOperation = AttributeError @@ -1285,7 +1285,7 @@ def _make_stream_binary(stream): """ try: fileno = stream.fileno() - except _UnsupportedOperation: + except (_UnsupportedOperation, AttributeError): pass else: _make_binary_on_windows(fileno) |
