1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 06:48:16 +00:00

python: fix behavior of client.ping() when device is locked

This commit is contained in:
matejcik 2020-08-05 15:45:57 +02:00
parent 3dd3d96957
commit 769ccf52c6
2 changed files with 7 additions and 1 deletions

View File

@ -28,6 +28,7 @@ _At the moment, the project does **not** adhere to [Semantic Versioning](https:/
- correctly calculate hashes for very small firmwares [f#1082]
- unified file arguments in trezorctl
- `TrezorClient.ping()` does not crash when device is PIN-locked
## [0.12.0] - 2020-04-01
[0.12.0]: https://github.com/trezor/trezor-firmware/compare/python/v0.11.6...python/v0.12.0

View File

@ -331,7 +331,12 @@ class TrezorClient:
# XXX this should be: `with self:`
try:
self.open()
return self.call_raw(messages.Ping(message=msg))
resp = self.call_raw(messages.Ping(message=msg))
if isinstance(resp, messages.ButtonRequest):
# device is PIN-locked.
# respond and hope for the best
resp = self._callback_button(resp)
return resp
finally:
self.close()