summaryrefslogtreecommitdiff
path: root/Lib/pty.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/pty.py')
-rw-r--r--Lib/pty.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/pty.py b/Lib/pty.py
index 889113c3dd..d3eb64f0a0 100644
--- a/Lib/pty.py
+++ b/Lib/pty.py
@@ -121,7 +121,9 @@ def fork():
# Explicitly open the tty to make it become a controlling tty.
tmp_fd = os.open(os.ttyname(STDOUT_FILENO), os.O_RDWR)
os.close(tmp_fd)
-
+ else:
+ os.close(slave_fd)
+
# Parent and child process.
return pid, master_fd