Issue #15064: Make BaseManager.__enter__() start server if necessary.

This commit is contained in:
Richard Oudkerk 2012-06-18 21:29:30 +01:00
parent 9c1feb88f3
commit ac38571f00
3 changed files with 31 additions and 9 deletions

View file

@ -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):