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")