makiling commited on
Commit
91db4c0
·
verified ·
1 Parent(s): d8606b1

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. polyreact/config.py +7 -2
polyreact/config.py CHANGED
@@ -3,8 +3,13 @@
3
  from __future__ import annotations
4
 
5
  from dataclasses import asdict, dataclass, field
6
- import importlib.resources as pkg_resources
7
- from importlib.resources.abc import Traversable
 
 
 
 
 
8
  from pathlib import Path
9
  from typing import Any, Sequence
10
 
 
3
  from __future__ import annotations
4
 
5
  from dataclasses import asdict, dataclass, field
6
+
7
+ try:
8
+ import importlib.resources as pkg_resources
9
+ from importlib.resources.abc import Traversable
10
+ except (ModuleNotFoundError, AttributeError): # pragma: no cover - compatibility
11
+ import importlib_resources as pkg_resources # type: ignore[no-redef]
12
+ from importlib_resources.abc import Traversable # type: ignore[assignment]
13
  from pathlib import Path
14
  from typing import Any, Sequence
15