code: def processEnded(self, status):
          
          self.cleanup()
  
          if status.value.exitCode is None:
              if self._did_timeout:
                  err = RuntimeError("Timeout waiting for Tor launch.")
              else:
                  err = RuntimeError(
                      "Tor was killed (%s)." % status.value.signal)
          else:
              err = RuntimeError(
                  "Tor exited with error-code %d" % status.value.exitCode)
  
          # hmmm, this log() should probably go away...not always an
          # error (e.g. .quit()
          log.err(err)
          self._maybe_notify_connected(Failure(err))
docs: :api:`twisted.internet.protocol.ProcessProtocol <ProcessProtocol>` API