diff options
| author | cookedm <cookedm@localhost> | 2006-07-13 02:48:24 +0000 |
|---|---|---|
| committer | cookedm <cookedm@localhost> | 2006-07-13 02:48:24 +0000 |
| commit | 705fa01506ea1d98add04ff2e2717a70c627507a (patch) | |
| tree | 76de7bc94b7dec41e5b5a31b27c753b3e10d6a30 /numpy/distutils/command | |
| parent | e30882f573121d69bfbc86c83f704c8b4657659c (diff) | |
| download | numpy-705fa01506ea1d98add04ff2e2717a70c627507a.tar.gz | |
Fix use of os.WEXITSTATUS and friends: only use if they exist
Diffstat (limited to 'numpy/distutils/command')
| -rw-r--r-- | numpy/distutils/command/config.py | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/numpy/distutils/command/config.py b/numpy/distutils/command/config.py index 003f04aad..ea79ef0a9 100644 --- a/numpy/distutils/command/config.py +++ b/numpy/distutils/command/config.py @@ -105,19 +105,20 @@ class config(old_config): libraries, library_dirs, lang) exe = os.path.join('.', exe) exitstatus, output = exec_command(exe, execute_in='.') - exitcode = os.WEXITSTATUS(exitstatus) - if os.WIFSIGNALED(exitstatus): - sig = os.WTERMSIG(exitstatus) - log.error('subprocess exited with signal %d' % (sig,)) - if sig == signal.SIGINT: - # control-C - raise KeyboardInterrupt - ok = exitstatus == 0 - ok = 1 + if hasattr(os, 'WEXITSTATUS'): + exitcode = os.WEXITSTATUS(exitstatus) + if os.WIFSIGNALED(exitstatus): + sig = os.WTERMSIG(exitstatus) + log.error('subprocess exited with signal %d' % (sig,)) + if sig == signal.SIGINT: + # control-C + raise KeyboardInterrupt + else: + exitcode = exitstatus + log.info("success!") except (CompileError, LinkError): - ok = 0 + log.info("failure.") - log.info(ok and "success!" or "failure.") self._clean() return exitcode, output |
