run-tests: only call WIFEXITED on systems it exists stable
authorSimon Heimberg <simohe@besonet.ch>
Wed, 02 Feb 2011 23:21:13 +0100
branchstable
changeset 878 e1a93489159d
parent 877 c2ca6e172fd8
child 879 0738a9d72c57
child 880 0b9f0c42b566
run-tests: only call WIFEXITED on systems it exists not on Windows or in jython [ original upstream message ]
tests/run-tests.py
--- a/tests/run-tests.py	Tue Feb 01 20:47:05 2011 +0100
+++ b/tests/run-tests.py	Wed Feb 02 23:21:13 2011 +0100
@@ -580,6 +580,7 @@
 
     return exitcode, postout
 
+wifexited = getattr(os, "WIFEXITED", lambda x: False)
 def run(cmd, options, replacements):
     """Run command in a sub-process, capturing the output (stdout and stderr).
     Return a tuple (exitcode, output).  output is None in debug mode."""
@@ -611,7 +612,7 @@
             proc.tochild.close()
             output = proc.fromchild.read()
             ret = proc.wait()
-            if os.WIFEXITED(ret):
+            if wifexited(ret):
                 ret = os.WEXITSTATUS(ret)
         except Timeout:
             vlog('# Process %d timed out - killing it' % proc.pid)