Upload hf_env/lib/python3.14/site-packages/multidict/_compat.py with huggingface_hub
Browse files
hf_env/lib/python3.14/site-packages/multidict/_compat.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import platform
|
| 3 |
+
|
| 4 |
+
NO_EXTENSIONS = bool(os.environ.get("MULTIDICT_NO_EXTENSIONS"))
|
| 5 |
+
|
| 6 |
+
PYPY = platform.python_implementation() == "PyPy"
|
| 7 |
+
|
| 8 |
+
USE_EXTENSIONS = not NO_EXTENSIONS and not PYPY
|
| 9 |
+
|
| 10 |
+
if USE_EXTENSIONS:
|
| 11 |
+
try:
|
| 12 |
+
from . import _multidict # type: ignore[attr-defined] # noqa: F401
|
| 13 |
+
except ImportError: # pragma: no cover
|
| 14 |
+
# FIXME: Refactor for coverage. See #837.
|
| 15 |
+
USE_EXTENSIONS = False
|