From 3a9f471acc936740fbfd268ea9120eb1ca17822d Mon Sep 17 00:00:00 2001 From: Jeff Quast Date: Fri, 1 Dec 2023 09:58:41 -0500 Subject: [PATCH] Fix KeyError in bin/wcwidth-browser for combining (#106) Resolve KeyError when launching wcwidth-browser.py with default unicode_version of 'auto', then pressing 'c' (for combining characters):: File "/Users/jq/Code/wcwidth/bin/wcwidth-browser.py", line 120, in __init__ for (begin, end) in ZERO_WIDTH[unicode_version]: ~~~~~~~~~~^^^^^^^^^^^^^^^^^ KeyError: 'auto' --- bin/wcwidth-browser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/wcwidth-browser.py b/bin/wcwidth-browser.py index 47e932a..0718cae 100755 --- a/bin/wcwidth-browser.py +++ b/bin/wcwidth-browser.py @@ -116,7 +116,7 @@ def __init__(self, width, unicode_version): """ self.characters = [] letters_o = ('o' * width) - for (begin, end) in ZERO_WIDTH[unicode_version]: + for (begin, end) in ZERO_WIDTH[_wcmatch_version(unicode_version)]: for val in [_val for _val in range(begin, end + 1) if _val <= LIMIT_UCS]: