FIX: expect loops when reading from dead process
This commit is contained in:
parent
eceed89113
commit
605c97a1e3
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue