Skip to content

Commit 4ba515d

Browse files
committed
test_openpty succeded on Gentoo, don't expect to fail it on this platform
1 parent 9d09e17 commit 4ba515d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Lib/test/test_pty.py

+9
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import_module('termios')
66

77
import errno
8+
import pathlib
89
import pty
910
import os
1011
import sys
@@ -75,6 +76,14 @@ def _readline(fd):
7576

7677
def expectedFailureIfStdinIsTTY(fun):
7778
# avoid isatty() for now
79+
PLATFORM = platform.system()
80+
if PLATFORM == "Linux":
81+
os_release = pathlib.Path("/etc/os-release")
82+
if os_release.exists():
83+
# Actually the file has complex multi-line structure,
84+
# these is no need to parse it for Gentoo check
85+
if 'gentoo' in os_release.read_text().lower():
86+
return fun
7887
try:
7988
tty.tcgetattr(pty.STDIN_FILENO)
8089
return unittest.expectedFailure(fun)

0 commit comments

Comments
 (0)