summaryrefslogtreecommitdiffstats
path: root/Lib/multiprocessing
diff options
context:
space:
mode:
authorRichard Oudkerk <shibturn@gmail.com>2012-06-18 20:29:30 (GMT)
committerRichard Oudkerk <shibturn@gmail.com>2012-06-18 20:29:30 (GMT)
commitac38571f00ccb5e1e0346ad27a8fac96d05e61c3 (patch)
treef9c8bc09a58917250daf9ac1beec8196b98a4912 /Lib/multiprocessing
parent9c1feb88f3511b35663ea4cc2a1f8cd2b21ee3d1 (diff)
downloadcpython-ac38571f00ccb5e1e0346ad27a8fac96d05e61c3.zip
cpython-ac38571f00ccb5e1e0346ad27a8fac96d05e61c3.tar.gz
cpython-ac38571f00ccb5e1e0346ad27a8fac96d05e61c3.tar.bz2
Issue #15064: Make BaseManager.__enter__() start server if necessary.
Diffstat (limited to 'Lib/multiprocessing')
-rw-r--r--Lib/multiprocessing/managers.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/multiprocessing/managers.py b/Lib/multiprocessing/managers.py
index f6611af..1ab147e 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):