summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pexpect/__init__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/pexpect/__init__.py b/pexpect/__init__.py
index 8017123..db47a5b 100644
--- a/pexpect/__init__.py
+++ b/pexpect/__init__.py
@@ -906,6 +906,7 @@ class spawn(object):
raise EOF('End Of File (EOF). Slow platform.')
stime = time.time()
+ death = False
while True:
r, w, e = self.__select([self.child_fd], [], [], poll_exit)
elapsed = time.time() - stime
@@ -917,6 +918,10 @@ class spawn(object):
# (pid, status) from waitpid(2) until at least one additional
# call to select(2) is issued. Therefor, we poll every
# `poll_exit` interval for waitpid() which may cause EOF.
+ death = True
+ # poll at least just one more time for output
+ poll_exit = 0
+ elif death:
self.flag_eof = True
raise EOF('End of File (EOF). Very slow platform.')
elif timeout is not None: