Skip to content

Commit 53c5543

Browse files
authored
Merge pull request #2361 from Exirel/unicode-info-ignore-type-check
unicode_info: ignore type check on unicodedata2
2 parents 2f50dbe + c728d52 commit 53c5543

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

sopel/modules/unicode_info.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@
1010

1111
from sopel import plugin
1212

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

1922

2023
def get_codepoint_name(char):

0 commit comments

Comments
 (0)