              else:
                  logger.debug("Sending SIGINT to process")
                  now = time()
                  self.process.send_signal(signal.SIGINT)
                  while True:
                      timeelapsed = time() - now
                      if self.process.poll() is not None:
                          break
                      if timeelapsed > timeout:
                          logger.error("Timeout reached sending Exit Signal")
                          self.terminate_all_children()
                  return
          else:
              self.terminate_all_children()
  
      @staticmethod
      def terminate_all_children():
 
</s> remove                 now = time()
 </s> add  </s> remove                 try:
                    logger.debug("Sending carriage return to process")
                    self.process.communicate(input="\n", timeout=timeout)
                except TimeoutExpired:
                    logger.error("Timeout reached sending Exit Signal")
                    self.terminate_all_children()
 </s> add                 logger.debug("Sending carriage return to process")
                con_in = win32console.GetStdHandle(  # pylint:disable=c-extension-no-member
                    win32console.STD_INPUT_HANDLE)  # pylint:disable=c-extension-no-member
                keypress = self.generate_windows_keypress("\n")
                con_in.WriteConsoleInput([keypress]) </s> remove         if self.is_gui:
 </s> add         if self.is_gui and os.name != "nt":
            while True:
                timeelapsed = time() - now
                if self.process.poll() is not None:
                    break
                if timeelapsed > timeout:
                    logger.error("Timeout reached sending Exit Signal")
                    self.terminate_all_children()
              else:
                  logger.debug("Sending SIGINT to process")
                  now = time()
                  self.process.send_signal(signal.SIGINT)
            while True:
                timeelapsed = time() - now
                if self.process.poll() is not None:
                    break
                if timeelapsed > timeout:
                    logger.error("Timeout reached sending Exit Signal")
                    self.terminate_all_children()
            while True:
                timeelapsed = time() - now
                if self.process.poll() is not None:
                    break
                if timeelapsed > timeout:
                    logger.error("Timeout reached sending Exit Signal")
                    self.terminate_all_children()
            while True:
                timeelapsed = time() - now
                if self.process.poll() is not None:
                    break
                if timeelapsed > timeout:
                    logger.error("Timeout reached sending Exit Signal")
                    self.terminate_all_children()
            while True:
                timeelapsed = time() - now
                if self.process.poll() is not None:
                    break
                if timeelapsed > timeout:
                    logger.error("Timeout reached sending Exit Signal")
                    self.terminate_all_children()
            while True:
                timeelapsed = time() - now
                if self.process.poll() is not None:
                    break
                if timeelapsed > timeout:
                    logger.error("Timeout reached sending Exit Signal")
                    self.terminate_all_children()
            while True:
                timeelapsed = time() - now
                if self.process.poll() is not None:
                    break
                if timeelapsed > timeout:
                    logger.error("Timeout reached sending Exit Signal")
                    self.terminate_all_children()
            while True:
                timeelapsed = time() - now
                if self.process.poll() is not None:
                    break
                if timeelapsed > timeout:
                    logger.error("Timeout reached sending Exit Signal")
                    self.terminate_all_children()
            while True:
                timeelapsed = time() - now
                if self.process.poll() is not None:
                    break
                if timeelapsed > timeout:
                    logger.error("Timeout reached sending Exit Signal")
                    self.terminate_all_children()
          else:
              self.terminate_all_children()
  
      @staticmethod
      def terminate_all_children():
keep keep keep keep replace replace replace replace replace replace replace replace keep keep keep keep keep
 Fix Timeout issue when terminating training on Windows 
lib/gui/wrapper.py