From 53153ac888af5c08e5a98446b424b7bd5f165177 Mon Sep 17 00:00:00 2001 From: noah Date: Sun, 20 Apr 2003 08:56:30 +0000 Subject: Added "exitstatus" to spawn object. git-svn-id: http://pexpect.svn.sourceforge.net/svnroot/pexpect/trunk@177 656d521f-e311-0410-88e0-e7920216d269 --- pexpect/pexpect.py | 3 +++ 1 file changed, 3 insertions(+) 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 -- cgit v1.2.1