Skip to content

Commit 3d99861

Browse files
gh-154226: Fix test_posix_pty_functions on Solaris (GH-154230)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent a0caab9 commit 3d99861

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Lib/test/test_os/test_os.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4727,6 +4727,13 @@ def test_posix_pty_functions(self):
47274727
son_path = os.ptsname(mother_fd)
47284728
son_fd = os.open(son_path, os.O_RDWR|os.O_NOCTTY)
47294729
self.addCleanup(os.close, son_fd)
4730+
if sys.platform.startswith('sunos'):
4731+
# The slave is not a terminal until these STREAMS modules
4732+
# are pushed onto it.
4733+
import fcntl
4734+
I_PUSH = 0x5302
4735+
fcntl.ioctl(son_fd, I_PUSH, b'ptem\0')
4736+
fcntl.ioctl(son_fd, I_PUSH, b'ldterm\0')
47304737
self.assertEqual(os.ptsname(mother_fd), os.ttyname(son_fd))
47314738

47324739
@warnings_helper.ignore_fork_in_thread_deprecation_warnings()

0 commit comments

Comments
 (0)