Skip to content

Commit

Permalink
Fix KeyError in bin/wcwidth-browser for combining (#106)
Browse files Browse the repository at this point in the history
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'
  • Loading branch information
jquast authored Dec 1, 2023
1 parent 9e0cedb commit 3a9f471
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/wcwidth-browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down

0 comments on commit 3a9f471

Please sign in to comment.