diff options
author | Richard Oudkerk <shibturn@gmail.com> | 2012-06-18 21:29:30 +0100 |
---|---|---|
committer | Richard Oudkerk <shibturn@gmail.com> | 2012-06-18 21:29:30 +0100 |
commit | ac38571f00ccb5e1e0346ad27a8fac96d05e61c3 (patch) | |
tree | f9c8bc09a58917250daf9ac1beec8196b98a4912 /Lib/multiprocessing/managers.py | |
parent | 9c1feb88f3511b35663ea4cc2a1f8cd2b21ee3d1 (diff) | |
download | cpython-git-ac38571f00ccb5e1e0346ad27a8fac96d05e61c3.tar.gz |
Issue #15064: Make BaseManager.__enter__() start server if necessary.
Diffstat (limited to 'Lib/multiprocessing/managers.py')
-rw-r--r-- | Lib/multiprocessing/managers.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/multiprocessing/managers.py b/Lib/multiprocessing/managers.py index f6611af9a6..1ab147e29e 100644 --- a/Lib/multiprocessing/managers.py +++ b/Lib/multiprocessing/managers.py @@ -561,6 +561,9 @@ class BaseManager(object): conn.close() def __enter__(self): + if self._state.value == State.INITIAL: + self.start() + assert self._state.value == State.STARTED return self def __exit__(self, exc_type, exc_val, exc_tb): |