Skip to content

Commit

Permalink
get out of the loop when subprocess terminated (fixes #56)
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu-g committed Oct 8, 2021
1 parent 6eed728 commit 088c89d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyknp/utils/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ def alarm_handler(signum, frame):
self.process.stdin.write(sentence.encode('utf-8'))
self.process.stdin.flush()
while True:
if self.process.poll() is not None:
break
line = self.process.stdout.readline().decode('utf-8').rstrip()
if re.search(pattern, line):
break
Expand Down

0 comments on commit 088c89d

Please sign in to comment.