(self, code=None)
Stop this manager. Invoking this method causes
        an invocation of ``run()`` to return.
Stop this manager. Invoking this method causes
        an invocation of ``run()`` to return.
Stop this manager . Invoking this method causes an invocation of run () to return .
def stop(self, code=None):
        """
        Stop this manager. Invoking this method causes
        an invocation of ``run()`` to return.
        """

        if self.__process not in (None, current_process()) and self.__process.is_alive():
            self.__process.terminate()
            self.__process.join(TIMEOUT)

            if self.__process.is_alive():
                kill(self.__process.pid, SIGKILL)

        if not self.running:
            return

        self._running = False

        self.fire(stopped(self))

        if self.root._executing_thread is None:
            for _ in range(3):
                self.tick()

        if code is not None:
            raise SystemExit(code)
def stop ( self , code = None ) : if self . __process not in ( None , current_process ( ) ) and self . __process . is_alive ( ) : self . __process . terminate ( ) self . __process . join ( TIMEOUT ) if self . __process . is_alive ( ) : kill ( self . __process . pid , SIGKILL ) if not self . running : return self . _running = False self . fire ( stopped ( self ) ) if self . root . _executing_thread is None : for _ in range ( 3 ) : self . tick ( ) if code is not None : raise SystemExit ( code )