--- a/mercurial/encoding.py Fri Oct 04 23:23:24 2024 -0400
+++ b/mercurial/encoding.py Sat Oct 05 15:00:37 2024 -0400
@@ -26,11 +26,12 @@
pycompat,
)
+from .interfaces import modules as intmod
from .pure import charencode as charencodepure
_Tlocalstr = TypeVar('_Tlocalstr', bound='localstr')
-charencode = policy.importmod('charencode')
+charencode: intmod.CharEncoding = policy.importmod('charencode')
isasciistr = charencode.isasciistr
asciilower = charencode.asciilower
@@ -41,15 +42,6 @@
unichr = chr
-if typing.TYPE_CHECKING:
- # TODO: make a stub file for .cext.charencode, and import here
- from .pure.charencode import (
- asciilower,
- asciiupper,
- isasciistr,
- jsonescapeu8fast as _jsonescapeu8fast,
- )
-
# These unicode characters are ignored by HFS+ (Apple Technote 1150,
# "Unicode Subtleties"), so we need to ignore them in some places for