Improved compatibility between During and Handler

This commit is contained in:
Tony Garnock-Jones 2021-09-08 13:07:26 +02:00
parent 4821f32e8b
commit 88bd5e1cf4
1 changed files with 3 additions and 1 deletions

View File

@ -65,6 +65,8 @@ class During(Handler):
def facet(turn):
if self.inert_ok:
turn.prevent_inert_check()
handler(turn, *args)
maybe_stop_action = handler(turn, *args)
if maybe_stop_action is not None:
turn.on_stop(maybe_stop_action)
return lambda turn: turn.stop(facet)
return facet_handler