mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Issue #15064: Make BaseManager.__enter__() start server if necessary.
This commit is contained in:
parent
9c1feb88f3
commit
ac38571f00
3 changed files with 31 additions and 9 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue