diff --git a/Lib/pty.py b/Lib/pty.py index eb3d5f1ff657bb..4b25ac32c8da14 100644 --- a/Lib/pty.py +++ b/Lib/pty.py @@ -39,8 +39,8 @@ def openpty(): except ImportError: return master_fd, slave_fd try: - ioctl(result, I_PUSH, "ptem") - ioctl(result, I_PUSH, "ldterm") + ioctl(slave_fd, I_PUSH, "ptem") + ioctl(slave_fd, I_PUSH, "ldterm") except OSError: pass return master_fd, slave_fd