FIX: expect loops when reading from dead process

This commit is contained in:
7marcus9 2022-10-04 20:09:43 +02:00
parent eceed89113
commit 605c97a1e3

View file

@ -28,6 +28,8 @@ def getBuffer(p):
def expect(p, s, t=0): def expect(p, s, t=0):
b = "" b = ""
while True: while True:
if p.poll() is not None:
raise Exception("Can't read data: Process Terminated")
b = b + getBuffer(p).decode() b = b + getBuffer(p).decode()
if s in b: if s in b:
return b return b