Commit 4eb8fa5
committed
gh-135329: prevent infinite traceback loop on Ctrl-C under external programs
When running Python REPL under another program (e.g., strace) and pressing Ctrl-C,
termios raises `EIO` during terminal state restoration, causing infinite exception tracebacks.
This patch catches `termios.error` with `errno.EIO` in `reader.prepare()` to avoid
recursive failure loops when restoring console state.1 parent 0f866cb commit 4eb8fa5
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
590 | 592 | | |
591 | 593 | | |
592 | 594 | | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
593 | 599 | | |
594 | 600 | | |
595 | 601 | | |
| |||
0 commit comments