              logger.debug("Sending Exit Signal")
              print("Sending Exit Signal", flush=True)
              if os.name == "nt":
                  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                 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                 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
 </s> add             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() </s> remove                 now = time()
 </s> add  </s> remove         if self.is_gui:
 </s> add         if self.is_gui and os.name != "nt":
            now = time()
              logger.debug("Sending Exit Signal")
              print("Sending Exit Signal", flush=True)
            now = time()
              if os.name == "nt":
                  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])
keep add keep keep keep keep keep keep
 Fix Timeout issue when terminating training on Windows 
lib/gui/wrapper.py