diff --git a/tests/test_trim.py b/tests/test_trim.py index 6daca7c..a041bf5 100644 --- a/tests/test_trim.py +++ b/tests/test_trim.py @@ -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)