Don't special-case an isascii implementation for Python 3.6

Python 3.7 is now our minimum-supported Python, and so we don't need to add
our own version of isascii any more.

See #2566.
This commit is contained in:
Dave Pearson 2022-10-10 16:21:19 +01:00
parent df76397390
commit 419265ba3f
No known key found for this signature in database
GPG Key ID: B413E0EF113D4ABF
1 changed files with 1 additions and 5 deletions

View File

@ -51,13 +51,9 @@ class Rule(JupyterMixin):
) -> RenderResult:
width = options.max_width
# Python3.6 doesn't have an isascii method on str
isascii = getattr(str, "isascii", None) or (
lambda s: all(ord(c) < 128 for c in s)
)
characters = (
"-"
if (options.ascii_only and not isascii(self.characters))
if (options.ascii_only and not self.characters.isascii())
else self.characters
)