1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-02-07 21:22:41 +00:00

chore(python): add refresh of invalid client to internal emulator

[no changelog]
This commit is contained in:
M1nd3r 2025-02-04 15:16:18 +01:00
parent 9d4d962998
commit 167c8a107f

View File

@ -93,6 +93,8 @@ class Emulator:
""" """
if self._client is None: if self._client is None:
raise RuntimeError raise RuntimeError
if self._client.is_invalidated:
self._client = self._client.get_new_client()
return self._client return self._client
def make_args(self) -> List[str]: def make_args(self) -> List[str]:
@ -112,7 +114,7 @@ class Emulator:
start = time.monotonic() start = time.monotonic()
try: try:
while True: while True:
if transport._ping(): if transport.ping():
break break
if self.process.poll() is not None: if self.process.poll() is not None:
raise RuntimeError("Emulator process died") raise RuntimeError("Emulator process died")