summaryrefslogtreecommitdiffstats
path: root/Lib/tty.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2023-10-14 05:50:41 (GMT)
committerGitHub <noreply@github.com>2023-10-14 05:50:41 (GMT)
commit84e2096fbdea880799f2fdb3f0992a8961106bed (patch)
treef1fb8bef511c750493f781a7a19d009ef4e5991c /Lib/tty.py
parent7284e0ef84e53f80b2e60c3f51e3467d67a275f3 (diff)
downloadcpython-84e2096fbdea880799f2fdb3f0992a8961106bed.zip
cpython-84e2096fbdea880799f2fdb3f0992a8961106bed.tar.gz
cpython-84e2096fbdea880799f2fdb3f0992a8961106bed.tar.bz2
gh-110392: Fix tty functions (GH-110642)
* tty.setraw() and tty.setcbreak() previously returned partially modified list of the original tty attributes. Now they return the correct list of the original tty attributes * tty.cfmakeraw() and tty.cfmakecbreak() now make a copy of the list of special characters before modifying it.
Diffstat (limited to 'Lib/tty.py')
-rw-r--r--Lib/tty.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/tty.py b/Lib/tty.py
index 7d91602..283e5c3 100644
--- a/Lib/tty.py
+++ b/Lib/tty.py
@@ -39,6 +39,7 @@ def cfmakeraw(mode):
# Case B: MIN>0, TIME=0
# A pending read shall block until MIN (here 1) bytes are received,
# or a signal is received.
+ mode[CC] = list(mode[CC])
mode[CC][VMIN] = 1
mode[CC][VTIME] = 0
@@ -54,6 +55,7 @@ def cfmakecbreak(mode):
# Case B: MIN>0, TIME=0
# A pending read shall block until MIN (here 1) bytes are received,
# or a signal is received.
+ mode[CC] = list(mode[CC])
mode[CC][VMIN] = 1
mode[CC][VTIME] = 0