Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_ext.py 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. from __future__ import absolute_import
  2. import sys
  3. supports_exec = True
  4. from .compat import _winapi as win32 # noqa
  5. if sys.platform.startswith("java"):
  6. _billiard = None
  7. else:
  8. try:
  9. import _billiard # noqa
  10. except ImportError:
  11. import _multiprocessing as _billiard # noqa
  12. supports_exec = False
  13. try:
  14. Connection = _billiard.Connection
  15. except AttributeError: # Py3
  16. from billiard.connection import Connection # noqa
  17. PipeConnection = getattr(_billiard, "PipeConnection", None)
  18. def ensure_multiprocessing():
  19. if _billiard is None:
  20. raise NotImplementedError("multiprocessing not supported")
  21. def ensure_SemLock():
  22. try:
  23. from _billiard import SemLock # noqa
  24. except ImportError:
  25. try:
  26. from _multiprocessing import SemLock # noqa
  27. except ImportError:
  28. raise ImportError("""\
  29. This platform lacks a functioning sem_open implementation, therefore,
  30. the required synchronization primitives needed will not function,
  31. see issue 3770.""")