apply suggestion Lib/_pyrepl/utils.py

Co-authored-by: grayjk <grayjk@gmail.com>
This commit is contained in:
yihong 2025-09-24 22:18:11 +08:00 committed by GitHub
parent 07aa4bcc8a
commit 41d2865a6d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -64,9 +64,9 @@ def str_width(c: str) -> int:
if ord(c) < 128:
return 1
# gh-139246 for zero-width joiner and combining characters
category = unicodedata.category(c)
if unicodedata.combining(c):
return 0
category = unicodedata.category(c)
if category == "Cf" and c != "\u00ad":
return 0
if "\u2028" <= c <= "\u2029":