              logger.debug("Not finished terminating")
              self.config.root.after(1000, self.terminate)
          else:
              logger.debug("Termination Complete. Cleaning up")
              _ = self.thread.get_result()  # Terminate the LongRunningTask object
              self.thread = None
  
      def terminate_in_thread(self, command, process):
          """ Terminate the subprocess """
          logger.debug("Terminating wrapper")
          if command == "train":
 
</s> remove             self.config.root.after(1000, self.terminate)
 </s> add             self._config.root.after(1000, self.terminate) </s> remove             self.thread = LongRunningTask(target=self.terminate_in_thread,
                                          args=(self.command, self.process))
            if self.command == "train":
                self.wrapper.tk_vars.is_training.set(False)
            self.thread.start()
            self.config.root.after(1000, self.terminate)
        elif not self.thread.complete.is_set():
 </s> add             self._thread = LongRunningTask(target=self._terminate_in_thread,
                                           args=(self._command, self._process))
            if self._command == "train":
                get_config().tk_vars.is_training.set(False)
            self._thread.start()
            self._config.root.after(1000, self.terminate)
        elif not self._thread.complete.is_set(): </s> remove     def terminate_in_thread(self, command, process):
        """ Terminate the subprocess """
 </s> add         Parameters
        ----------
        command: str
            The command that is running

        process: :class:`subprocess.Popen`
            The running process

        Returns
        -------
        bool
            ``True`` when this function exits
        """ </s> remove             timeout = self.config.user_config_dict.get("timeout", 120)
 </s> add             timeout = self._config.user_config_dict.get("timeout", 120) </s> remove     def terminate(self):
        """ Terminate the running process in a LongRunningTask so we can still
            output to console """
        if self.thread is None:
 </s> add     def terminate(self) -> None:
        """ Terminate the running process in a LongRunningTask so console can still be updated
        console """
        if self._thread is None:
            _ = self._thread.get_result()  # Terminate the LongRunningTask object
            self._thread = None

    def _terminate_in_thread(self, command: str, process: Popen) -> bool:
        """ Terminate the subprocess
              logger.debug("Not finished terminating")
              self.config.root.after(1000, self.terminate)
          else:
              logger.debug("Termination Complete. Cleaning up")
            _ = self._thread.get_result()  # Terminate the LongRunningTask object
            self._thread = None

    def _terminate_in_thread(self, command: str, process: Popen) -> bool:
        """ Terminate the subprocess
            _ = self._thread.get_result()  # Terminate the LongRunningTask object
            self._thread = None

    def _terminate_in_thread(self, command: str, process: Popen) -> bool:
        """ Terminate the subprocess
  
      def terminate_in_thread(self, command, process):
          """ Terminate the subprocess """
          logger.debug("Terminating wrapper")
          if command == "train":
keep keep keep keep replace replace keep keep keep keep keep
 bugfix: GUI force stdout/stderr reading to utf-8 
lib/gui/wrapper.py