From 605c97a1e3147bdd711c7488bddc9cc68f3e7bce Mon Sep 17 00:00:00 2001 From: 7marcus9 <7m9_c3hgit@7m9.eu> Date: Tue, 4 Oct 2022 20:09:43 +0200 Subject: [PATCH] FIX: expect loops when reading from dead process --- keymatic.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keymatic.py b/keymatic.py index 654b4a4..9db61d6 100755 --- a/keymatic.py +++ b/keymatic.py @@ -28,6 +28,8 @@ def getBuffer(p): def expect(p, s, t=0): b = "" while True: + if p.poll() is not None: + raise Exception("Can't read data: Process Terminated") b = b + getBuffer(p).decode() if s in b: return b