June 24, 2008
11:39 p.m.
On Tue, 2008-06-24 at 16:43 -0600, Nathan wrote:
Is there a more sane way to get the exit code from a ProcessProtocol than by parsing it out of reason.value in ProcessProtocol.processEnded()? I can't seem to find the error code by itself anywhere. (see example code at bottom)
If I replace "print reason.value" with "print dir(reason)" below, then I get the following output for both successful and unsuccessful spawns:
reason.value will be instance of ProcessExited or something (it's in twisted.internet.error), which should have exitCode attribute or something. Check the API reference for twisted.internet.error.