Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address review
  • Loading branch information
sobolevn committed May 9, 2024
commit 95fc77b4a6025c9f3c5c6783acdd308f74fd7c0c
12 changes: 10 additions & 2 deletions Doc/whatsnew/3.14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ email
* The *isdst* parameter has been removed from :func:`email.utils.localtime`.
(Contributed by Hugo van Kemenade in :gh:`118798`.)

pty
___

* Remove deprecated ``pty.master_open`` and ``pty.slave_open``.
They had previously raised a :exc:`DeprecationWarning` since Python 3.12.
Comment thread
sobolevn marked this conversation as resolved.
Outdated
Comment thread
sobolevn marked this conversation as resolved.
Outdated

Others
------

Expand All @@ -118,8 +124,10 @@ Others
are removed. They had previously raised a :exc:`DeprecationWarning`
since Python 3.12.

* Remove deprecated ``pty.master_open`` and ``pty.slave_open``.
They had previously raised a :exc:`DeprecationWarning` since Python 3.12.
* :mod:`itertools` support for copy, deepcopy, and pickle operations.
These had previously raised a :exc:`DeprecationWarning` since Python 3.12.
(Contributed by Raymond Hettinger in :gh:`101588`.)


Porting to Python 3.14
======================
Expand Down
12 changes: 11 additions & 1 deletion Lib/pty.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,17 @@ def openpty():
except (AttributeError, OSError):
pass
master_fd, slave_name = _open_terminal()
slave_fd = slave_open(slave_name)

slave_fd = os.open(slave_name, os.O_RDWR)
try:
from fcntl import ioctl, I_PUSH
except ImportError:
return master_fd, slave_fd
try:
ioctl(result, I_PUSH, "ptem")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

result is a NameError now.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in #124406

ioctl(result, I_PUSH, "ldterm")
except OSError:
pass
return master_fd, slave_fd

def _open_terminal():
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.