  
      def getch(self):
          """ Returns a keyboard character after kbhit() has been called.
              Should not be called in the same program as getarrow(). """
          if self.is_gui:
              return None
          if os.name == "nt":
              return msvcrt.getch().decode("utf-8")
          return sys.stdin.read(1)
  
 
</s> remove         if self.is_gui:
 </s> add         if self.is_gui and os.name != "nt": </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()
        if self.is_gui and os.name != "nt":
  
      def getch(self):
          """ Returns a keyboard character after kbhit() has been called.
              Should not be called in the same program as getarrow(). """
        if self.is_gui and os.name != "nt":
              return None
          if os.name == "nt":
              return msvcrt.getch().decode("utf-8")
          return sys.stdin.read(1)
  
keep keep keep keep replace keep keep keep keep keep
 Fix Timeout issue when terminating training on Windows 
lib/keypress.py