diff options
author | noah <noah@656d521f-e311-0410-88e0-e7920216d269> | 2002-09-23 20:51:08 +0000 |
---|---|---|
committer | noah <noah@656d521f-e311-0410-88e0-e7920216d269> | 2002-09-23 20:51:08 +0000 |
commit | 0dacccfdaae6cc44c43e7965cf2e5fcbde7f5640 (patch) | |
tree | cc4f5bce35ae52d6e1b03915c9fcec9ee71aed2f | |
parent | 0c9cc4e92bf60c0ef3b92da7cb3adc698cbc3021 (diff) | |
download | pexpect-0dacccfdaae6cc44c43e7965cf2e5fcbde7f5640.tar.gz |
Removed some lines of code that could not be reached.
git-svn-id: http://pexpect.svn.sourceforge.net/svnroot/pexpect/trunk@90 656d521f-e311-0410-88e0-e7920216d269
-rw-r--r-- | pexpect/pexpect.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pexpect/pexpect.py b/pexpect/pexpect.py index 88276ec..1746b35 100644 --- a/pexpect/pexpect.py +++ b/pexpect/pexpect.py @@ -308,8 +308,6 @@ class spawn: self.match = None raise - assert 0 == 1, 'Should not get here.' - def expect_list(self, pattern_list, local_timeout = None): """This is called by expect(). This takes a list of compiled regular expressions. This returns the index into the pattern_list @@ -351,8 +349,6 @@ class spawn: self.match = None raise - assert 0 == 1, 'Should not get here.' - # def expect_eof(self, timeout = None): # """This reads from the child until the end of file is found. # A timeout exception may be thrown. @@ -468,7 +464,11 @@ class spawn: """This tests if the child process is running or not. This returns 1 if the child process appears to be running or 0 if not. """ - status = os.waitpid (self.pid, os.WNOHANG) + try: + status = os.waitpid (self.pid, os.WNOHANG) + except OSError, e: + return 0 + if status[0] == 0: return 1 |