Using this code: ... def processEnded(self, reason): print "processEnded, task %s, status %s" % (self.task, reason.value.exitCode,)
Here is what I get from a normally terminated process processEnded, task ['sleep', '4']31662, status 0 But now I kill the subprocess, with SIGTERM, and I get: processEnded, task ['sleep', '15']31663, status None This seems to disagree with the twisted process doc. Instead of an exitCode, I seem to have gotten 'None' .processEnded(status): This is called when the child process has been reaped, and receives information about the process' exit status. The status is passed in the form of a Failure instance, created with a .value that either holds a ProcessDone object if the process terminated normally (it died of natural causes instead of receiving a signal, and if the exit code was 0), or a ProcessTerminated object (with an .exitCode attribute) if something went wrong. This scheme may seem a bit weird, but I trust that it proves useful when dealing with exceptions that occur in asynchronous code. _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python