
Jan. 20, 2006
5:41 p.m.
Hi there, I'm using distutils.spawn.spawn() to run subprocesses during my build commands. It now happens that one of those subprocesses will return a non-zero value that doesn't strictly correspond to an error, and thus I'd like to catch it from within my python code. It appears spawn() itself will raise a message containing a stringified version of the exit code, but not the exit code itself. This seems to imply that, in order to discriminate on the exit value, I have to catch DistutilsExecError, and then parse the string. This seems rather unelegant. Is there some better way ? Could the exception be modified to contain the original code (as an integral value) ? Thanks, Stefan