mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-23 07:58:09 +00:00
24 lines
455 B
Python
24 lines
455 B
Python
import sys
|
|
|
|
sys.path.append("../src")
|
|
|
|
from ubinascii import hexlify, unhexlify # noqa: F401
|
|
|
|
import unittest # noqa: F401
|
|
|
|
from trezor import utils # noqa: F401
|
|
|
|
|
|
def await_result(task: Awaitable) -> Any:
|
|
value = None
|
|
while True:
|
|
try:
|
|
result = task.send(value)
|
|
except StopIteration as e:
|
|
return e.value
|
|
|
|
if result:
|
|
value = await_result(result)
|
|
else:
|
|
value = None
|