Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix: address comments
Signed-off-by: yihong0618 <[email protected]>
  • Loading branch information
yihong0618 committed Aug 25, 2025
commit 5ff6b9bb9c06fa2c33a58d16e1c6b644884e6019
10 changes: 3 additions & 7 deletions Lib/_pyrepl/unix_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,13 +339,11 @@ def prepare(self):
try:
tcsetattr(self.input_fd, termios.TCSADRAIN, raw)
except termios.error as e:
if e.args[0] == errno.EIO:
if e.args[0] != errno.EIO:
# gh-135329
# When running under external programs (like strace),
# tcsetattr may fail with EIO. We can safely ignore this
# and continue with default terminal settings.
pass
else:
raise

# In macOS terminal we need to deactivate line wrap via ANSI escape code
Expand Down Expand Up @@ -381,13 +379,11 @@ def restore(self):
try:
tcsetattr(self.input_fd, termios.TCSADRAIN, self.__svtermstate)
except termios.error as e:
if e.args[0] == errno.EIO:
if e.args[0] != errno.EIO:
# gh-135329
# When running under external programs (like strace),
# tcsetattr may fail with EIO. We can safely ignore this
# as the terminal state will be restored by the external program.
pass
else:
# and continue with default terminal settings.
raise

Comment thread
yihong0618 marked this conversation as resolved.
if platform.system() == "Darwin" and os.getenv("TERM_PROGRAM") == "Apple_Terminal":
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
prevent infinite traceback loop on Ctrl-C for strace
Prevent infinite traceback loop when sending CTRL^C to Python through ``strace``.
Loading