mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
[3.14] gh-77065: Use putwch
instead of putch
in getpass.win_getpass
(GH-134058) (#134059)
gh-77065: Use `putwch` instead of `putch` in `getpass.win_getpass` (GH-134058)
(cherry picked from commit 52a7a22a6b
)
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
This commit is contained in:
parent
31deafb8ee
commit
438f464a5a
1 changed files with 3 additions and 3 deletions
|
@ -119,9 +119,9 @@ def win_getpass(prompt='Password: ', stream=None, *, echo_char=None):
|
||||||
raise KeyboardInterrupt
|
raise KeyboardInterrupt
|
||||||
if c == '\b':
|
if c == '\b':
|
||||||
if echo_char and pw:
|
if echo_char and pw:
|
||||||
msvcrt.putch('\b')
|
msvcrt.putwch('\b')
|
||||||
msvcrt.putch(' ')
|
msvcrt.putwch(' ')
|
||||||
msvcrt.putch('\b')
|
msvcrt.putwch('\b')
|
||||||
pw = pw[:-1]
|
pw = pw[:-1]
|
||||||
else:
|
else:
|
||||||
pw = pw + c
|
pw = pw + c
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue