Skip to content

Commit

Permalink
tests/test_trim: remove obsolete compat code.
Browse files Browse the repository at this point in the history
  • Loading branch information
jwilk committed Mar 15, 2024
1 parent 04c0b66 commit 00cc11f
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions tests/test_trim.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,9 @@
assert_greater_equal,
)

if sys.version_info >= (3, 7):
isascii = str.isascii # pylint: disable=no-member
else:
def isascii(s):
return re.fullmatch(r'[\0-\x7F]*', s) is not None

def xlen(s):
n = sum(1 if c else 0 for c in regex.split(r'(\X)', s))
if isascii(s):
if s.isascii():
assert n == len(s)
else:
assert n <= len(s)
Expand Down

0 comments on commit 00cc11f

Please sign in to comment.