@@ -1805,7 +1805,7 @@ class PopenNoDestructor(subprocess.Popen):
1805
1805
def __del__ (self ):
1806
1806
pass
1807
1807
1808
- @mock .patch ("subprocess._posixsubprocess.fork_exec " )
1808
+ @mock .patch ("subprocess._fork_exec " )
1809
1809
def test_exception_errpipe_normal (self , fork_exec ):
1810
1810
"""Test error passing done through errpipe_write in the good case"""
1811
1811
def proper_error (* args ):
@@ -1822,7 +1822,7 @@ def proper_error(*args):
1822
1822
with self .assertRaises (IsADirectoryError ):
1823
1823
self .PopenNoDestructor (["non_existent_command" ])
1824
1824
1825
- @mock .patch ("subprocess._posixsubprocess.fork_exec " )
1825
+ @mock .patch ("subprocess._fork_exec " )
1826
1826
def test_exception_errpipe_bad_data (self , fork_exec ):
1827
1827
"""Test error passing done through errpipe_write where its not
1828
1828
in the expected format"""
@@ -2112,7 +2112,7 @@ def raise_it():
2112
2112
preexec_fn = raise_it )
2113
2113
except subprocess .SubprocessError as e :
2114
2114
self .assertTrue (
2115
- subprocess ._posixsubprocess ,
2115
+ subprocess ._fork_exec ,
2116
2116
"Expected a ValueError from the preexec_fn" )
2117
2117
except ValueError as e :
2118
2118
self .assertIn ("coconut" , e .args [0 ])
@@ -2600,11 +2600,11 @@ def prepare():
2600
2600
preexec_fn = prepare )
2601
2601
except ValueError as err :
2602
2602
# Pure Python implementations keeps the message
2603
- self .assertIsNone (subprocess ._posixsubprocess )
2603
+ self .assertIsNone (subprocess ._fork_exec )
2604
2604
self .assertEqual (str (err ), "surrogate:\uDCff " )
2605
2605
except subprocess .SubprocessError as err :
2606
2606
# _posixsubprocess uses a default message
2607
- self .assertIsNotNone (subprocess ._posixsubprocess )
2607
+ self .assertIsNotNone (subprocess ._fork_exec )
2608
2608
self .assertEqual (str (err ), "Exception occurred in preexec_fn." )
2609
2609
else :
2610
2610
self .fail ("Expected ValueError or subprocess.SubprocessError" )
0 commit comments