diff options
author | Jelmer Vernooij <jelmer@jelmer.uk> | 2023-01-28 15:14:49 +0000 |
---|---|---|
committer | Jelmer Vernooij <jelmer@jelmer.uk> | 2023-01-28 15:33:32 +0000 |
commit | 99e17060527c24a2d4b5bea34d97dc3c4f7bf6d1 (patch) | |
tree | 159cad7c36f66281a7a05354ff08164ff0d6bb1f /python/subunit/v2.py | |
parent | f49eb718b7f863ccfcc8b57f3251d138036af6c6 (diff) | |
download | subunit-git-99e17060527c24a2d4b5bea34d97dc3c4f7bf6d1.tar.gz |
Avoid use of extras - python3's hasattr is safe
Diffstat (limited to 'python/subunit/v2.py')
-rw-r--r-- | python/subunit/v2.py | 6 |
1 files changed, 2 insertions, 4 deletions
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] |