Skip to content

gh-135329: prevent infinite traceback loop on Ctrl-C under external p… #135366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Lib/_pyrepl/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
from . import commands, console, input
from .utils import wlen, unbracket, disp_str, gen_colors, THEME
from .trace import trace
import termios
import errno


# types
Expand Down Expand Up @@ -590,6 +592,10 @@ def prepare(self) -> None:
self.dirty = True
self.last_command = None
self.calc_screen()
except termios.error as e:
if e.args[0] == errno.EIO:
return
raise
except BaseException:
self.restore()
raise
Expand Down
Loading