summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornoah <noah@656d521f-e311-0410-88e0-e7920216d269>2003-02-25 22:05:17 +0000
committernoah <noah@656d521f-e311-0410-88e0-e7920216d269>2003-02-25 22:05:17 +0000
commit1243c6f957549bdb0a8edc4245db014ea7bb529e (patch)
treeee34b604c3cfb7dc8198cd326587bce6c0d9862d
parent47b713566d16fef5510799daff546299a2d9f166 (diff)
downloadpexpect-1243c6f957549bdb0a8edc4245db014ea7bb529e.tar.gz
The default timeouts of None was ambiguous because read_nonblocking
used that to denote no timeout (which makes sense). But some methods used None to denote a default timeout of self.timeout (and expect_list didn't even do this right). I changed everything so that the default timeout is now -1. If this is used then the actual timeout will get set to self.timeout. git-svn-id: http://pexpect.svn.sourceforge.net/svnroot/pexpect/trunk@156 656d521f-e311-0410-88e0-e7920216d269
-rw-r--r--pexpect/pexpect.py4
-rwxr-xr-xpexpect/tools/testsweep.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/pexpect/pexpect.py b/pexpect/pexpect.py
index 9f4ff40..ccae6c8 100644
--- a/pexpect/pexpect.py
+++ b/pexpect/pexpect.py
@@ -542,7 +542,7 @@ class spawn:
compiled_pattern_list = self.compile_pattern_list(pattern)
return self.expect_list(compiled_pattern_list, timeout)
- def expect_exact (self, pattern_list, timeout = None):
+ def expect_exact (self, pattern_list, timeout = -1):
"""This is similar to expect() except that it takes
list of plain strings instead of regular expressions.
The idea is that this should be much faster. It could also be
@@ -599,7 +599,7 @@ class spawn:
self.match = None
raise
- def expect_list(self, pattern_list, timeout = None):
+ def expect_list(self, pattern_list, timeout = -1):
"""This is called by expect(). This takes a list of compiled
regular expressions. This returns the index into the pattern_list
that matched the child's output.
diff --git a/pexpect/tools/testsweep.py b/pexpect/tools/testsweep.py
index 1e7bf6c..ba15174 100755
--- a/pexpect/tools/testsweep.py
+++ b/pexpect/tools/testsweep.py
@@ -8,7 +8,7 @@ import getpass
def test_platform (platform_menu, platform_python_path):
try:
s = pexpect.spawn ('ssh noah@cf.sourceforge.net')
- #s.setlog (sys.stdout)
+ s.setlog (sys.stdout)
i = s.expect (['password:', 'yes/no'])
if i == 1:
s.sendline ('yes')