code: def quit(self):
          
  
          try:
              self.transport.signalProcess('TERM')
              d = Deferred()
              self._on_exit.append(d)
  
          except error.ProcessExitedAlready:
              self.transport.loseConnection()
              d = succeed(None)
          except Exception:
              d = fail()
          return d
docs: This will terminate (with SIGTERM) the underlying Tor process.
  
          :returns: a Deferred that callback()'s (with None) when the
              process has actually exited.