From 419265ba3f6ebe3a12b31ea7ad65f2e2247f585a Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Mon, 10 Oct 2022 16:21:19 +0100 Subject: [PATCH] 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. --- rich/rule.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/rich/rule.py b/rich/rule.py index f1159524..fb3d4327 100644 --- a/rich/rule.py +++ b/rich/rule.py @@ -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 )