1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-02-28 15:22:14 +00:00

fixup! fix(python): runaway emulator process

This commit is contained in:
Martin Milata 2025-02-27 10:31:14 +01:00
parent 8e72395631
commit 57ae7199f1

View File

@ -138,8 +138,6 @@ class Emulator:
LOG.info(f"Emulator ready after {time.monotonic() - start:.3f} seconds") LOG.info(f"Emulator ready after {time.monotonic() - start:.3f} seconds")
def wait(self, timeout: Optional[float] = None) -> int: def wait(self, timeout: Optional[float] = None) -> int:
global _RUNNING_PIDS
assert self.process is not None, "Emulator not started" assert self.process is not None, "Emulator not started"
ret = self.process.wait(timeout=timeout) ret = self.process.wait(timeout=timeout)
_RUNNING_PIDS.remove(self.process) _RUNNING_PIDS.remove(self.process)
@ -167,8 +165,6 @@ class Emulator:
) )
def start(self) -> None: def start(self) -> None:
global _RUNNING_PIDS
if self.process: if self.process:
if self.process.poll() is not None: if self.process.poll() is not None:
# process has died, stop and start again # process has died, stop and start again
@ -198,8 +194,6 @@ class Emulator:
self._client.open() self._client.open()
def stop(self) -> None: def stop(self) -> None:
global _RUNNING_PIDS
if self._client: if self._client:
self._client.close() self._client.close()
self._client = None self._client = None