1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-31 19:08:28 +00:00

fixup! fix(python): improve robustness of TrezorClientDebugLink setup

This commit is contained in:
matejcik 2024-07-30 15:07:55 +02:00 committed by M1nd3r
parent 780a22f68f
commit 4cae454e47

View File

@ -1288,6 +1288,7 @@ class TrezorClientDebugLink(TrezorClient):
# prompt, which is in TINY mode and does not respond to `Ping`.
cancel_msg = mapping.DEFAULT_MAPPING.encode(messages.Cancel())
self.transport.begin_session()
try:
self.transport.write(*cancel_msg)
message = "SYNC" + secrets.token_hex(8)
@ -1300,6 +1301,8 @@ class TrezorClientDebugLink(TrezorClient):
resp = mapping.DEFAULT_MAPPING.decode(msg_id, msg_bytes)
except Exception:
pass
finally:
self.transport.end_session()
def mnemonic_callback(self, _) -> str:
word, pos = self.debug.read_recovery_word()