mirror of https://github.com/Textualize/rich.git
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:
parent
df76397390
commit
419265ba3f
|
@ -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
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue