@@ -1499,8 +1499,7 @@ def test_returns_pid(self):
14991499 pidfile.write(str(os.getpid()))
15001500 """
15011501 args = self .python_args ('-c' , script )
1502- pid = posix .posix_spawn (args [0 ], args ,
1503- os .environ )
1502+ pid = posix .posix_spawn (args [0 ], args , os .environ )
15041503 self .assertEqual (os .waitpid (pid , 0 ), (pid , 0 ))
15051504 with open (pidfile ) as f :
15061505 self .assertEqual (f .read (), str (pid ))
@@ -1538,7 +1537,7 @@ def test_empty_file_actions(self):
15381537 self .NOOP_PROGRAM [0 ],
15391538 self .NOOP_PROGRAM ,
15401539 os .environ ,
1541- []
1540+ file_actions = []
15421541 )
15431542 self .assertEqual (os .waitpid (pid , 0 ), (pid , 0 ))
15441543
@@ -1691,37 +1690,38 @@ def test_multiple_file_actions(self):
16911690 ]
16921691 pid = posix .posix_spawn (self .NOOP_PROGRAM [0 ],
16931692 self .NOOP_PROGRAM ,
1694- os .environ , file_actions )
1693+ os .environ ,
1694+ file_actions = file_actions )
16951695 self .assertEqual (os .waitpid (pid , 0 ), (pid , 0 ))
16961696
16971697 def test_bad_file_actions (self ):
16981698 args = self .NOOP_PROGRAM
16991699 with self .assertRaises (TypeError ):
1700- posix .posix_spawn (args [0 ], args ,
1701- os . environ , [None ])
1700+ posix .posix_spawn (args [0 ], args , os . environ ,
1701+ file_actions = [None ])
17021702 with self .assertRaises (TypeError ):
1703- posix .posix_spawn (args [0 ], args ,
1704- os . environ , [()])
1703+ posix .posix_spawn (args [0 ], args , os . environ ,
1704+ file_actions = [()])
17051705 with self .assertRaises (TypeError ):
1706- posix .posix_spawn (args [0 ], args ,
1707- os . environ , [(None ,)])
1706+ posix .posix_spawn (args [0 ], args , os . environ ,
1707+ file_actions = [(None ,)])
17081708 with self .assertRaises (TypeError ):
1709- posix .posix_spawn (args [0 ], args ,
1710- os . environ , [(12345 ,)])
1709+ posix .posix_spawn (args [0 ], args , os . environ ,
1710+ file_actions = [(12345 ,)])
17111711 with self .assertRaises (TypeError ):
1712- posix .posix_spawn (args [0 ], args ,
1713- os . environ , [(os .POSIX_SPAWN_CLOSE ,)])
1712+ posix .posix_spawn (args [0 ], args , os . environ ,
1713+ file_actions = [(os .POSIX_SPAWN_CLOSE ,)])
17141714 with self .assertRaises (TypeError ):
1715- posix .posix_spawn (args [0 ], args ,
1716- os . environ , [(os .POSIX_SPAWN_CLOSE , 1 , 2 )])
1715+ posix .posix_spawn (args [0 ], args , os . environ ,
1716+ file_actions = [(os .POSIX_SPAWN_CLOSE , 1 , 2 )])
17171717 with self .assertRaises (TypeError ):
1718- posix .posix_spawn (args [0 ], args ,
1719- os . environ , [(os .POSIX_SPAWN_CLOSE , None )])
1718+ posix .posix_spawn (args [0 ], args , os . environ ,
1719+ file_actions = [(os .POSIX_SPAWN_CLOSE , None )])
17201720 with self .assertRaises (ValueError ):
1721- posix .posix_spawn (args [0 ], args ,
1722- os .environ ,
1723- [( os . POSIX_SPAWN_OPEN , 3 , __file__ + '\0 ' ,
1724- os .O_RDONLY , 0 )])
1721+ posix .posix_spawn (args [0 ], args , os . environ ,
1722+ file_actions = [( os .POSIX_SPAWN_OPEN ,
1723+ 3 , __file__ + '\0 ' ,
1724+ os .O_RDONLY , 0 )])
17251725
17261726 def test_open_file (self ):
17271727 outfile = support .TESTFN
@@ -1736,8 +1736,8 @@ def test_open_file(self):
17361736 stat .S_IRUSR | stat .S_IWUSR ),
17371737 ]
17381738 args = self .python_args ('-c' , script )
1739- pid = posix .posix_spawn (args [0 ], args ,
1740- os . environ , file_actions )
1739+ pid = posix .posix_spawn (args [0 ], args , os . environ ,
1740+ file_actions = file_actions )
17411741 self .assertEqual (os .waitpid (pid , 0 ), (pid , 0 ))
17421742 with open (outfile ) as f :
17431743 self .assertEqual (f .read (), 'hello' )
@@ -1754,9 +1754,8 @@ def test_close_file(self):
17541754 closefile.write('is closed %d' % e.errno)
17551755 """
17561756 args = self .python_args ('-c' , script )
1757- pid = posix .posix_spawn (args [0 ], args ,
1758- os .environ ,
1759- [(os .POSIX_SPAWN_CLOSE , 0 ),])
1757+ pid = posix .posix_spawn (args [0 ], args , os .environ ,
1758+ file_actions = [(os .POSIX_SPAWN_CLOSE , 0 ),])
17601759 self .assertEqual (os .waitpid (pid , 0 ), (pid , 0 ))
17611760 with open (closefile ) as f :
17621761 self .assertEqual (f .read (), 'is closed %d' % errno .EBADF )
@@ -1773,8 +1772,8 @@ def test_dup2(self):
17731772 (os .POSIX_SPAWN_DUP2 , childfile .fileno (), 1 ),
17741773 ]
17751774 args = self .python_args ('-c' , script )
1776- pid = posix .posix_spawn (args [0 ], args ,
1777- os . environ , file_actions )
1775+ pid = posix .posix_spawn (args [0 ], args , os . environ ,
1776+ file_actions = file_actions )
17781777 self .assertEqual (os .waitpid (pid , 0 ), (pid , 0 ))
17791778 with open (dupfile ) as f :
17801779 self .assertEqual (f .read (), 'hello' )
0 commit comments