form line 218:
if timeout == -1:
child = spawn(command, maxread=2000, logfile=logfile, cwd=cwd, env=env)
else:
child = spawn(command, timeout=timeout, maxread=2000, logfile=logfile, cwd=cwd, env=env)
line 219 should be:
child = spawn(command, maxread=2000, timeout=-1 logfile=logfile, cwd=cwd, env=env)
or simply take out the if else block altogether and pass timeout along to spawn
because:
class spawn (object):
"""This is the main class interface for Pexpect. Use this class to start
and control child applications. """
def __init__(self, command, args=[], timeout=30, maxread=2000, searchwindowsize=None, logfile=None, cwd=None, env=None):
If you specify timeout=-1 you get timeout = 30
The convention in Pexpect is that timeout=-1 tells it to inherit a default timeout, and timeout=None means no timeout. If you think there's still an issue, please report it on Github. https://github.com/pexpect/pexpect/pull/62