File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -356,9 +356,8 @@ def prepare(self):
356356 # per-readline preparations:
357357 try :
358358 self .__svtermstate = tcgetattr (self .input_fd )
359- except termios .error : # (25, 'Inappropriate ioctl for device')
360- # assert not os.fdopen(self.input_fd).isatty()
361- raise EOFError
359+ except termios .error as exc :
360+ raise EOFError ("could not prepare fd %d: %s" % (self .input_fd , exc ))
362361 self ._prepared = True
363362 raw = self .__svtermstate .copy ()
364363 raw .iflag |= termios .ICRNL
Original file line number Diff line number Diff line change 1+ import pytest
2+
3+
4+ def test_eoferror ():
5+ from pyrepl .unix_console import UnixConsole
6+
7+ console = UnixConsole (f_in = 99 )
8+ with pytest .raises (EOFError ) as excinfo :
9+ console .prepare ()
10+ assert excinfo .value .args == (
11+ "could not prepare fd 99: (9, 'Bad file descriptor')" ,
12+ )
You can’t perform that action at this time.
0 commit comments