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 2aecfaa
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions tests/test_trim.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

import re
import sys

import regex

import lib.text as M
Expand All @@ -30,15 +27,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 2aecfaa

Please sign in to comment.