We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9627694 commit b5f9af5Copy full SHA for b5f9af5
src/humanize/i18n.py
@@ -3,10 +3,12 @@
3
from __future__ import annotations
4
5
import gettext as gettext_module
6
-import importlib.resources
7
-import os
8
-import pathlib
9
from threading import local
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
10
+ import os
11
+ import pathlib
12
13
__all__ = ["activate", "deactivate", "decimal_separator", "thousands_separator"]
14
@@ -39,6 +41,8 @@ def _get_default_locale_path() -> pathlib.Path | None:
39
41
if not package:
40
42
return None
43
44
+ import importlib.resources
45
46
with importlib.resources.as_file(importlib.resources.files(package)) as pkg:
47
return pkg / "locale"
48
0 commit comments