diff --git a/src/trezor/loop.py b/src/trezor/loop.py index 5c796ecf2..5a24c645a 100644 --- a/src/trezor/loop.py +++ b/src/trezor/loop.py @@ -201,6 +201,13 @@ class signal(Syscall): self.task = None self.value = _NO_VALUE + def __iter__(self): + try: + return (yield self) + except: + self.task = None + raise + class wait(Syscall): '''