_compat.py 316 B

1234567891011121314
  1. import os
  2. import platform
  3. NO_EXTENSIONS = bool(os.environ.get("MULTIDICT_NO_EXTENSIONS"))
  4. PYPY = platform.python_implementation() == "PyPy"
  5. USE_EXTENSIONS = not NO_EXTENSIONS and not PYPY
  6. if USE_EXTENSIONS:
  7. try:
  8. from . import _multidict # noqa
  9. except ImportError:
  10. USE_EXTENSIONS = False