summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pexpect/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pexpect/__init__.py b/pexpect/__init__.py
index 074bc99..8017123 100644
--- a/pexpect/__init__.py
+++ b/pexpect/__init__.py
@@ -882,8 +882,8 @@ class spawn(object):
if timeout == -1:
timeout = self.timeout
-
- poll_exit = min(poll_exit, timeout)
+ elif timeout is not None:
+ poll_exit = min(poll_exit, timeout)
# Note that some systems such as Solaris do not give an EOF when
# the child dies. In fact, you can still try to read