X-Git-Url: https://git.distorted.org.uk/~mdw/cfd/blobdiff_plain/0b5f869b689a085655df9e1a261eacf8c7facade..59b8d96508ed3becd57a5fb9ae1d3368d5074f94:/mdwsetup.py diff --git a/mdwsetup.py b/mdwsetup.py index a6ca3f4..dfa217e 100644 --- a/mdwsetup.py +++ b/mdwsetup.py @@ -59,10 +59,10 @@ class SubprocessFailure (Exception): me.file = file me.rc = rc def __str__(me): - if WIFEXITED(me.rc): - return '%s failed (rc = %d)' % (me.file, WEXITSTATUS(me.rc)) - elif WIFSIGNALED(me.rc): - return '%s died (signal %d)' % (me.file, WTERMSIG(me.rc)) + if OS.WIFEXITED(me.rc): + return '%s failed (rc = %d)' % (me.file, OS.WEXITSTATUS(me.rc)) + elif OS.WIFSIGNALED(me.rc): + return '%s died (signal %d)' % (me.file, OS.WTERMSIG(me.rc)) else: return '%s died inexplicably' % (me.file) @@ -181,7 +181,7 @@ class Generate (BaseGenFile): temp = me.target + '.new' with open(temp, 'w') as ft: rc = SUB.call([SYS.executable, me.sources[0]], stdout = ft) - if rc != 0: raise SubprocessFailure, (source, rc) + if rc != 0: raise SubprocessFailure, (me.sources[0], rc << 8) OS.rename(temp, me.target) ## Backward compatibility.