mirror of
https://github.com/python/cpython.git
synced 2025-11-26 13:22:51 +00:00
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.
This commit is contained in:
parent
7284e0ef84
commit
84e2096fbd
3 changed files with 12 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue