__init__.py 923 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. globals().update((name, getattr(context._default_context, name))
  20. for name in context._default_context.__all__)
  21. __all__ = context._default_context.__all__
  22. #
  23. # XXX These should not really be documented or public.
  24. #
  25. SUBDEBUG = 5
  26. SUBWARNING = 25
  27. #
  28. # Alias for main module -- will be reset by bootstrapping child processes
  29. #
  30. if '__main__' in sys.modules:
  31. sys.modules['__mp_main__'] = sys.modules['__main__']