From 167c8a107f1c91e1819e96e9a87cf6d3d1c48428 Mon Sep 17 00:00:00 2001 From: M1nd3r Date: Tue, 4 Feb 2025 15:16:18 +0100 Subject: [PATCH] chore(python): add refresh of invalid client to internal emulator [no changelog] --- python/src/trezorlib/_internal/emulator.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/src/trezorlib/_internal/emulator.py b/python/src/trezorlib/_internal/emulator.py index 4f6d56f8ed..2eb0e332bb 100644 --- a/python/src/trezorlib/_internal/emulator.py +++ b/python/src/trezorlib/_internal/emulator.py @@ -93,6 +93,8 @@ class Emulator: """ if self._client is None: raise RuntimeError + if self._client.is_invalidated: + self._client = self._client.get_new_client() return self._client def make_args(self) -> List[str]: @@ -112,7 +114,7 @@ class Emulator: start = time.monotonic() try: while True: - if transport._ping(): + if transport.ping(): break if self.process.poll() is not None: raise RuntimeError("Emulator process died")