Skip to content

Commit

Permalink
Merge pull request #7 from wesinator/patch-2
Browse files Browse the repository at this point in the history
Handle correct unicodedata method exception
  • Loading branch information
yamatt authored Nov 7, 2024
2 parents 2126505 + da50962 commit c9d2791
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions homoglyphs_fork/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ def detect(cls, char):
# try detect category by unicodedata
try:
category = unicodedata.name(char).split()[0]
except TypeError:
# In Python2 unicodedata.name raise error for non-unicode chars
except (TypeError, ValueError):
# unicodedata.name raises ValueError for non-unicode chars, TypeError on empty string
pass
else:
if category in data['aliases']:
Expand Down

0 comments on commit c9d2791

Please sign in to comment.