Skip to content

Commit 5f74b9e

Browse files
miss-islingtonserhiy-storchakaclaude
authored
[3.13] gh-154226: Fix test_posix_pty_functions on Solaris (GH-154230) (GH-154243)
(cherry picked from commit 3d99861) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent f6a807e commit 5f74b9e

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Lib/test/test_os.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4788,6 +4788,13 @@ def test_posix_pty_functions(self):
47884788
son_path = os.ptsname(mother_fd)
47894789
son_fd = os.open(son_path, os.O_RDWR|os.O_NOCTTY)
47904790
self.addCleanup(os.close, son_fd)
4791+
if sys.platform.startswith('sunos'):
4792+
# The slave is not a terminal until these STREAMS modules
4793+
# are pushed onto it.
4794+
import fcntl
4795+
I_PUSH = 0x5302
4796+
fcntl.ioctl(son_fd, I_PUSH, b'ptem\0')
4797+
fcntl.ioctl(son_fd, I_PUSH, b'ldterm\0')
47914798
self.assertEqual(os.ptsname(mother_fd), os.ttyname(son_fd))
47924799

47934800
@unittest.skipUnless(hasattr(os, 'spawnl'), "need os.spawnl()")

0 commit comments

Comments
 (0)