diff options
author | Jelmer Vernooij <jelmer@jelmer.uk> | 2023-01-28 15:34:44 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-28 15:34:44 +0000 |
commit | 9200d9eeff3d624d592d01d618ad30f02dc68afd (patch) | |
tree | 159cad7c36f66281a7a05354ff08164ff0d6bb1f | |
parent | f49eb718b7f863ccfcc8b57f3251d138036af6c6 (diff) | |
parent | 99e17060527c24a2d4b5bea34d97dc3c4f7bf6d1 (diff) | |
download | subunit-git-9200d9eeff3d624d592d01d618ad30f02dc68afd.tar.gz |
Merge pull request #58 from jelmer/drop-extras
Drop extras
-rw-r--r-- | python/subunit/__init__.py | 1 | ||||
-rw-r--r-- | python/subunit/filters.py | 3 | ||||
-rw-r--r-- | python/subunit/v2.py | 6 | ||||
-rwxr-xr-x | setup.py | 1 |
4 files changed, 3 insertions, 8 deletions
diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py index 971e408..144557e 100644 --- a/python/subunit/__init__.py +++ b/python/subunit/__init__.py @@ -124,7 +124,6 @@ import subprocess import sys import unittest -from extras import safe_hasattr from testtools import content, content_type, ExtendedToOriginalDecorator from testtools.content import TracebackContent from testtools.compat import _b, _u diff --git a/python/subunit/filters.py b/python/subunit/filters.py index ec7e9f3..ba534e3 100644 --- a/python/subunit/filters.py +++ b/python/subunit/filters.py @@ -17,7 +17,6 @@ from optparse import OptionParser import sys -from extras import safe_hasattr from testtools import CopyStreamResult, StreamResult, StreamResultRouter from subunit import ( @@ -183,7 +182,7 @@ def run_filter_script(result_factory, description, post_run_hook=None, input_stream=find_stream(sys.stdin, args)) if post_run_hook: post_run_hook(result) - if not safe_hasattr(result, 'wasSuccessful'): + if not hasattr(result, 'wasSuccessful'): result = result.decorated if result.wasSuccessful(): sys.exit(0) diff --git a/python/subunit/v2.py b/python/subunit/v2.py index 2137165..db240c3 100644 --- a/python/subunit/v2.py +++ b/python/subunit/v2.py @@ -14,6 +14,7 @@ # limitations under that license. # +import builtins import codecs import datetime import select @@ -21,9 +22,6 @@ import struct import sys import zlib -from extras import safe_hasattr, try_imports -builtins = try_imports(['__builtin__', 'builtins']) - import subunit import subunit.iso8601 as iso8601 @@ -448,7 +446,7 @@ class ByteStreamToStreamResult(object): 'Bad checksum - calculated (0x%x), stored (0x%x)' % ( crc, packet_crc)) - if safe_hasattr(builtins, 'memoryview'): + if hasattr(builtins, 'memoryview'): body = memoryview(packet[-1]) else: body = packet[-1] @@ -58,7 +58,6 @@ setup( package_dir={'subunit': 'python/subunit'}, python_requires=">=3.7", install_requires=[ - 'extras', 'testtools>=0.9.34', ], entry_points={ |