From 3a5d29848be9883112cb17703d18106c06d463bd Mon Sep 17 00:00:00 2001 From: Jan Pochyla Date: Tue, 17 May 2016 15:16:59 +0200 Subject: [PATCH] Wait supports syscall instead of gens now --- src/trezor/loop.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/trezor/loop.py b/src/trezor/loop.py index 1780305f0..cc6f2c631 100644 --- a/src/trezor/loop.py +++ b/src/trezor/loop.py @@ -82,7 +82,10 @@ class Wait(): self.callback = gen def _wait(self, gen): - result = yield from gen + if isinstance(gen, type_gen): + result = yield from gen + else: + result = yield gen self._finish(gen, result) def _finish(self, gen, result): @@ -91,7 +94,7 @@ class Wait(): schedule(self.callback, (gen, result)) if self.exit_others: for g in self.scheduled: - if g is not gen: + if g is not gen and isinstance(g, type_gen): unschedule(g) unblock(g) g.close()