__init__.py 916 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #
  2. # Package analogous to 'threading.py' but using processes
  3. #
  4. # multiprocessing/__init__.py
  5. #
  6. # This package is intended to duplicate the functionality (and much of
  7. # the API) of threading.py but uses processes instead of threads. A
  8. # subpackage 'multiprocessing.dummy' has the same API but is a simple
  9. # wrapper for 'threading'.
  10. #
  11. # Copyright (c) 2006-2008, R Oudkerk
  12. # Licensed to PSF under a Contributor Agreement.
  13. #
  14. import sys
  15. from . import context
  16. #
  17. # Copy stuff from default context
  18. #
  19. __all__ = [x for x in dir(context._default_context) if not x.startswith('_')]
  20. globals().update((name, getattr(context._default_context, name)) for name in __all__)
  21. #
  22. # XXX These should not really be documented or public.
  23. #
  24. SUBDEBUG = 5
  25. SUBWARNING = 25
  26. #
  27. # Alias for main module -- will be reset by bootstrapping child processes
  28. #
  29. if '__main__' in sys.modules:
  30. sys.modules['__mp_main__'] = sys.modules['__main__']