MCPcopy Index your code
hub / github.com/python/cpython / __enter__

Method __enter__

Lib/multiprocessing/managers.py:646–657  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

644 conn.close()
645
646 def __enter__(self):
647 if self._state.value == State.INITIAL:
648 self.start()
649 if self._state.value != State.STARTED:
650 if self._state.value == State.INITIAL:
651 raise ProcessError("Unable to start server")
652 elif self._state.value == State.SHUTDOWN:
653 raise ProcessError("Manager has shut down")
654 else:
655 raise ProcessError(
656 "Unknown state {!r}".format(self._state.value))
657 return self
658
659 def __exit__(self, exc_type, exc_val, exc_tb):
660 self.shutdown()

Callers

nothing calls this directly

Calls 3

startMethod · 0.95
ProcessErrorClass · 0.85
formatMethod · 0.45

Tested by

no test coverage detected