Antonio Cuni  committed 8e3ee8c

raise a specific exception in this case, which makes it easier to catch the case of unsupported terminal; also, make sure that this case is caugth by simple_interact.check

  • Participants
  • Parent commits 2d01704
  • Branches default

Comments (0)

Files changed (1)

File pyrepl/

 from pyrepl.console import Console, Event
 from pyrepl import unix_eventqueue
-_error = (termios.error, curses.error)
+class InvalidTerminal(RuntimeError):
+    pass
+_error = (termios.error, curses.error, InvalidTerminal)
 # there are arguments for changing this to "refresh"
 SIGWINCH_EVENT = 'repaint'
 def _my_getstr(cap, optional=0):
     r = curses.tigetstr(cap)
     if not optional and r is None:
-        raise RuntimeError, \
+        raise InvalidTerminal, \
               "terminal doesn't have the required '%s' capability"%cap
     return r