From 0ab70cf8bdc5676e5eae2b9e9b5c45e53021578f Mon Sep 17 00:00:00 2001 From: James Gerity Date: Wed, 4 Sep 2024 12:18:53 -0400 Subject: [PATCH] Fix Unicode category check --- Lib/_pyrepl/input.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/_pyrepl/input.py b/Lib/_pyrepl/input.py index 21c24eb5cde3e3..f5957113744a60 100644 --- a/Lib/_pyrepl/input.py +++ b/Lib/_pyrepl/input.py @@ -91,7 +91,7 @@ def push(self, evt): if d is None: if self.verbose: print("invalid") - if self.stack or len(key) > 1 or unicodedata.category(key) == "C": + if self.stack or len(key) > 1 or unicodedata.category(key).startswith("C"): self.results.append((self.invalid_cls, self.stack + [key])) else: # small optimization: