From 5992ce3223a8b34c73b654eaec8c11a0982610c7 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 --- 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 8ec49a8690..8772770b40 100644 --- a/python/src/trezorlib/_internal/emulator.py +++ b/python/src/trezorlib/_internal/emulator.py @@ -103,6 +103,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]: @@ -122,7 +124,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")