This commit is contained in:
Tony Garnock-Jones 2022-01-08 13:43:42 +01:00
parent a813780e8d
commit 04d46585fd
1 changed files with 3 additions and 6 deletions

View File

@ -333,12 +333,9 @@ class Turn:
def stop(self, facet = None, continuation = None): def stop(self, facet = None, continuation = None):
if facet is None: if facet is None:
facet = self._facet facet = self._facet
if facet.parent is None: if continuation is not None:
self.stop_actor() facet.on_stop(continuation)
else: facet._terminate(True)
if continuation is not None:
facet.on_stop(continuation)
facet._terminate(True)
# can also be used as a decorator # can also be used as a decorator
def on_stop(self, a): def on_stop(self, a):