Skip to content

Commit

Permalink
Merge pull request #2361 from Exirel/unicode-info-ignore-type-check
Browse files Browse the repository at this point in the history
unicode_info: ignore type check on unicodedata2
  • Loading branch information
dgw authored Nov 1, 2022
2 parents 2f50dbe + c728d52 commit 53c5543
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions sopel/modules/unicode_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@

from sopel import plugin

# unicodedata2 can provide a more-modern UCD than the one that comes with Python, use it if present
# Python built-in unicodedata uses UCD version 13 (as of Python 3.10)
# unicodedata2 can provide a more recent version, so we use that if present
# See also: https://docs.python.org/3/library/unicodedata.html
try:
import unicodedata2 as unicodedata
# ignore type check for these imports (no stubs for unicodedata2)
import unicodedata2 as unicodedata # type: ignore[import]
except ImportError:
import unicodedata
import unicodedata # type: ignore[no-redef]


def get_codepoint_name(char):
Expand Down

0 comments on commit 53c5543

Please sign in to comment.