Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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