diff options
| author | Stephen Finucane <stephenfin@redhat.com> | 2021-12-15 10:18:17 +0000 |
|---|---|---|
| committer | Stephen Finucane <stephenfin@redhat.com> | 2021-12-15 10:38:24 +0000 |
| commit | 01682c1dcfd5fa92f08c00437fadb4650b8d4bf9 (patch) | |
| tree | a4ba51740bf8bd1d145b0469b8d5109262570d34 /python/subunit/__init__.py | |
| parent | 6340268cad342f41c357604535c842f5df1d4a10 (diff) | |
| download | subunit-git-01682c1dcfd5fa92f08c00437fadb4650b8d4bf9.tar.gz | |
Remove logic for Python < 3.6
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Diffstat (limited to 'python/subunit/__init__.py')
| -rw-r--r-- | python/subunit/__init__.py | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py index 6917f42..614c647 100644 --- a/python/subunit/__init__.py +++ b/python/subunit/__init__.py @@ -42,8 +42,7 @@ Twisted. See the ``TestProtocolServer`` parser class for more details. Subunit includes extensions to the Python ``TestResult`` protocol. These are all done in a compatible manner: ``TestResult`` objects that do not implement the extension methods will not cause errors to be raised, instead the extension -will either lose fidelity (for instance, folding expected failures to success -in Python versions < 2.7 or 3.1), or discard the extended data (for extra +will either lose fidelity, or discard the extended data (for extra details, tags, timestamping and progress markers). The test outcome methods ``addSuccess``, ``addError``, ``addExpectedFailure``, @@ -513,9 +512,7 @@ class TestProtocolServer(object): """ self.client = ExtendedToOriginalDecorator(client) if stream is None: - stream = sys.stdout - if sys.version_info > (3, 0): - stream = stream.buffer + stream = sys.stdout.buffer self._stream = stream self._forward_stream = forward_stream or DiscardStream() # state objects we can switch too @@ -1292,11 +1289,7 @@ def _make_binary_on_windows(fileno): def _unwrap_text(stream): """Unwrap stream if it is a text stream to get the original buffer.""" exceptions = (_UnsupportedOperation, IOError) - if sys.version_info > (3, 0): - unicode_type = str - else: - unicode_type = unicode - exceptions += (ValueError,) + unicode_type = str try: # Read streams if type(stream.read(0)) is unicode_type: |
