36
36
u"/var/lib/sss/mc/passwd"
37
37
]
38
38
39
- CLOSE_STDIN = object
40
-
41
39
42
40
def pytest_addoption (parser ):
43
41
parser .addoption (
@@ -475,6 +473,8 @@ class Testdir(object):
475
473
476
474
"""
477
475
476
+ CLOSE_STDIN = object
477
+
478
478
class TimeoutExpired (Exception ):
479
479
pass
480
480
@@ -1059,15 +1059,15 @@ def popen(
1059
1059
env ["USERPROFILE" ] = env ["HOME" ]
1060
1060
kw ["env" ] = env
1061
1061
1062
- if stdin is CLOSE_STDIN :
1062
+ if stdin is Testdir . CLOSE_STDIN :
1063
1063
kw ["stdin" ] = subprocess .PIPE
1064
1064
elif isinstance (stdin , bytes ):
1065
1065
kw ["stdin" ] = subprocess .PIPE
1066
1066
else :
1067
1067
kw ["stdin" ] = stdin
1068
1068
1069
1069
popen = subprocess .Popen (cmdargs , stdout = stdout , stderr = stderr , ** kw )
1070
- if stdin is CLOSE_STDIN :
1070
+ if stdin is Testdir . CLOSE_STDIN :
1071
1071
popen .stdin .close ()
1072
1072
elif isinstance (stdin , bytes ):
1073
1073
popen .stdin .write (stdin )
@@ -1093,7 +1093,7 @@ def run(self, *cmdargs, **kwargs):
1093
1093
__tracebackhide__ = True
1094
1094
1095
1095
timeout = kwargs .pop ("timeout" , None )
1096
- stdin = kwargs .pop ("stdin" , CLOSE_STDIN )
1096
+ stdin = kwargs .pop ("stdin" , Testdir . CLOSE_STDIN )
1097
1097
raise_on_kwargs (kwargs )
1098
1098
1099
1099
popen_kwargs = {"stdin" : stdin }
0 commit comments