mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-06-25 18:37:50 +00:00
Close tty_fd after dup2
This commit is contained in:
parent
b06cbc9465
commit
20cffc728e
1 changed files with 2 additions and 1 deletions
|
|
@ -408,7 +408,8 @@ def get_password(opts: RCOptions) -> str:
|
|||
except OSError:
|
||||
pass
|
||||
else:
|
||||
os.dup2(tty_fd, sys.stdin.fileno())
|
||||
with open(tty_fd, closefd=True):
|
||||
os.dup2(tty_fd, sys.stdin.fileno())
|
||||
else:
|
||||
try:
|
||||
with open(resolve_custom_file(opts.password_file)) as f:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue