Skip to content

Commit 0fd9e6a

Browse files
committed
Fix Translator type hint
1 parent d9cd9ca commit 0fd9e6a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

unidecode/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from pathlib import Path
2222

2323
Cache = {} # type: Dict[int, Optional[Sequence[Optional[str]]]]
24-
Translator: Optional[dict[str, int]] = None
24+
Translator = None # type: Optional[Dict[int, str]]
2525

2626
class UnidecodeError(ValueError):
2727
def __init__(self, message: str, index: Optional[int] = None) -> None:
@@ -139,7 +139,7 @@ def _unidecode(string: str, errors: str, replace_str:str) -> str:
139139

140140
return ''.join(retval)
141141

142-
def preload_translator() -> dict[str, int]:
142+
def preload_translator() -> Dict[int, str]:
143143
global Translator
144144

145145
if Translator is None:

0 commit comments

Comments
 (0)