# HG changeset patch # User Simon Heimberg # Date 2011-02-02 22:21:13 # Node ID 31fdb04cb5e8506e6837260c830d7788ca7b8100 # Parent ce07defe7d9f04ead5555a36f2c627807fc9cd30 run-tests: only call WIFEXITED on systems it exists not on Windows or in jython diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -580,6 +580,7 @@ def tsttest(test, options, replacements) 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 @@ def run(cmd, options, replacements): 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)