File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 5
5
import_module ('termios' )
6
6
7
7
import errno
8
+ import pathlib
8
9
import pty
9
10
import os
10
11
import sys
@@ -75,6 +76,19 @@ def _readline(fd):
75
76
76
77
def expectedFailureIfStdinIsTTY (fun ):
77
78
# 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
+ # bpo-41818:
87
+ # Gentoo passes the test,
88
+ # all other tested Linux distributions fail.
89
+ # Should not apply @unittest.expectedFailure() on Gentoo
90
+ # to keep the buildbot fleet happy.
91
+ return fun
78
92
try :
79
93
tty .tcgetattr (pty .STDIN_FILENO )
80
94
return unittest .expectedFailure (fun )
You can’t perform that action at this time.
0 commit comments