1. Jędrzej Nowak
  2. pyrepl

Commits

Amaury Forgeot d'Arc  committed 2d0d32c

Fix the termios module: now RPython termios
raises OSError to better convey the errno attribute.
Also fix a failure with readline when stdin is not a tty.

  • Participants
  • Parent commits fd34a1e
  • Branches default

Comments (0)

Files changed (1)

File pyrepl/unix_eventqueue.py

View file
  • Ignore whitespace
 from pyrepl.console import Event
 from pyrepl import curses
 from termios import tcgetattr, VERASE
+import os
 
 _keynames = {
     "delete" : "kdch1",
             keycode = curses.tigetstr(tiname)
             if keycode:
                 our_keycodes[keycode] = unicode(key)
-        our_keycodes[tcgetattr(fd)[6][VERASE]] = u'backspace'
+        if os.isatty(fd):
+            our_keycodes[tcgetattr(fd)[6][VERASE]] = u'backspace'
         self.k = self.ck = keymap.compile_keymap(our_keycodes)
         self.events = []
         self.buf = []