1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-05 21:10:57 +00:00

core/loop: fix last commit

This commit is contained in:
Jan Pochyla 2019-08-22 17:36:04 +02:00
parent 2c8b90f86e
commit 7789a29d50

View File

@ -386,15 +386,19 @@ class chan:
def put(self, value: Any) -> None:
put = chan.Put(self, value)
try:
yield put
return (yield put)
except: # noqa: E722
self.putters.remove((put.task, value))
entry = (put.task, value)
if entry in self.putters:
self.putters.remove(entry)
raise
def take(self) -> None:
take = chan.Take(self)
try:
yield take
return (yield take)
except: # noqa: E722
if take.task in self.takers:
self.takers.remove(take.task)
raise