# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
__author__ = "Steven Knight <knight at baldmt dot com>"
-__revision__ = "TestCmd.py 0.31.D001 2008/01/01 09:05:59 knight"
-__version__ = "0.31"
+__revision__ = "TestCmd.py 0.32.D001 2008/10/30 23:00:04 knight"
+__version__ = "0.32"
import errno
import os
arr = [(file, line, name, text)] + arr
atfrom = "at"
for file, line, name, text in arr[skip:]:
- if name == "?":
+ if name in ("?", "<module>"):
name = ""
else:
name = " (" + name + ")"
self.stdout.close()
self.resultcode = self.stderr.close()
def wait(self):
- return self.resultcode
+ resultcode = self.resultcode
+ if os.WIFEXITED(resultcode):
+ return os.WEXITSTATUS(resultcode)
+ elif os.WIFSIGNALED(resultcode):
+ return os.WTERMSIG(resultcode)
+ else:
+ return None
else:
try:
self.stdin = self.tochild
self.stdout = self.fromchild
self.stderr = self.childerr
+ def wait(self, *args, **kw):
+ resultcode = apply(popen2.Popen3.wait, (self,)+args, kw)
+ if os.WIFEXITED(resultcode):
+ return os.WEXITSTATUS(resultcode)
+ elif os.WIFSIGNALED(resultcode):
+ return os.WTERMSIG(resultcode)
+ else:
+ return None
subprocess.Popen = Popen3
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
__author__ = "Steven Knight <knight at baldmt dot com>"
-__revision__ = "TestCommon.py 0.31.D001 2008/01/01 09:05:59 knight"
-__version__ = "0.31"
+__revision__ = "TestCommon.py 0.32.D001 2008/10/30 23:00:04 knight"
+__version__ = "0.32"
import copy
import os
return None
return _status(self) != status
def _status(self):
- return self.status # p.wait() has already retrieved the OS status from the status val; don't do it again here!
-# if os.WIFEXITED(self.status):
-# return os.WEXITSTATUS(self.status)
-# elif os.WIFSIGNALED(self.status):
-# return os.WTERMSIG(self.status)
-# else:
-# return None
+ return self.status
elif os.name == 'nt':
def _failed(self, status = 0):
return not (self.status is None or status is None) and \