Make PipeIOServer a contextmanager
This commit is contained in:
@ -77,3 +77,10 @@ class PipeIOServer(Thread):
|
||||
|
||||
def wait(self):
|
||||
self._stop_event.wait()
|
||||
|
||||
def __enter__(self):
|
||||
self.start()
|
||||
return self
|
||||
|
||||
def __exit__(self, type_, value, tb):
|
||||
self.stop()
|
||||
|
Reference in New Issue
Block a user