mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Fix for issue11236 getpass.getpass to respond ctrl-c or ctrl-z
This commit is contained in:
parent
ba42fd5801
commit
7cfe5f88ce
1 changed files with 1 additions and 1 deletions
|
@ -62,7 +62,7 @@ def unix_getpass(prompt='Password: ', stream=None):
|
||||||
try:
|
try:
|
||||||
old = termios.tcgetattr(fd) # a copy to save
|
old = termios.tcgetattr(fd) # a copy to save
|
||||||
new = old[:]
|
new = old[:]
|
||||||
new[3] &= ~(termios.ECHO|termios.ISIG) # 3 == 'lflags'
|
new[3] &= ~termios.ECHO # 3 == 'lflags'
|
||||||
tcsetattr_flags = termios.TCSAFLUSH
|
tcsetattr_flags = termios.TCSAFLUSH
|
||||||
if hasattr(termios, 'TCSASOFT'):
|
if hasattr(termios, 'TCSASOFT'):
|
||||||
tcsetattr_flags |= termios.TCSASOFT
|
tcsetattr_flags |= termios.TCSASOFT
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue