summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornoah <noah@656d521f-e311-0410-88e0-e7920216d269>2003-04-20 08:56:30 +0000
committernoah <noah@656d521f-e311-0410-88e0-e7920216d269>2003-04-20 08:56:30 +0000
commit53153ac888af5c08e5a98446b424b7bd5f165177 (patch)
tree5e94f8ccd86704960ac7ba5c061edfb45e27330c
parent19e3cae80665ed6a1739a2484106dbba72e28e33 (diff)
downloadpexpect-53153ac888af5c08e5a98446b424b7bd5f165177.tar.gz
Added "exitstatus" to spawn object.
git-svn-id: http://pexpect.svn.sourceforge.net/svnroot/pexpect/trunk@177 656d521f-e311-0410-88e0-e7920216d269
-rw-r--r--pexpect/pexpect.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/pexpect/pexpect.py b/pexpect/pexpect.py
index f9256c8..4fa8201 100644
--- a/pexpect/pexpect.py
+++ b/pexpect/pexpect.py
@@ -115,6 +115,7 @@ class spawn:
self.timeout = timeout
self.child_fd = -1 # initially closed
self.__child_fd_owner = None
+ self.exitstatus = None
self.pid = None
self.log_file = None
self.before = None
@@ -478,8 +479,10 @@ class spawn:
# # This is dangerous because if I am wrong then this could block.
# pid, status = os.waitpid (self.pid, 0)
+ self.exitstatus = None
# I didn't OR this together because I want hooks for debugging.
if os.WIFEXITED (status):
+ self.exitstatus = os.WEXITSTATUS(status)
return 0
elif os.WIFSTOPPED (status):
return 0