File tree 2 files changed +14
-3
lines changed
2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -356,9 +356,8 @@ def prepare(self):
356
356
# per-readline preparations:
357
357
try :
358
358
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 ))
362
361
self ._prepared = True
363
362
raw = self .__svtermstate .copy ()
364
363
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 (
9
+ EOFError ,
10
+ match = "^could not prepare fd 99: .*Bad file descriptor"
11
+ ):
12
+ console .prepare ()
You can’t perform that action at this time.
0 commit comments