@@ -655,7 +655,6 @@ def _use_posix_spawn():
655655
656656
657657_USE_POSIX_SPAWN = _use_posix_spawn ()
658- _HAVE_POSIX_SPAWNP = hasattr (os , 'posix_spawnp' )
659658
660659
661660class Popen (object ):
@@ -1443,10 +1442,7 @@ def _get_handles(self, stdin, stdout, stderr):
14431442
14441443
14451444 def _posix_spawn (self , args , executable , env , restore_signals ):
1446- """Execute program using os.posix_spawnp().
1447-
1448- Or use os.posix_spawn() if os.posix_spawnp() is not available.
1449- """
1445+ """Execute program using os.posix_spawn()."""
14501446 if env is None :
14511447 env = os .environ
14521448
@@ -1460,10 +1456,7 @@ def _posix_spawn(self, args, executable, env, restore_signals):
14601456 sigset .append (signum )
14611457 kwargs ['setsigdef' ] = sigset
14621458
1463- if _HAVE_POSIX_SPAWNP :
1464- self .pid = os .posix_spawnp (executable , args , env , ** kwargs )
1465- else :
1466- self .pid = os .posix_spawn (executable , args , env , ** kwargs )
1459+ self .pid = os .posix_spawn (executable , args , env , ** kwargs )
14671460
14681461 def _execute_child (self , args , executable , preexec_fn , close_fds ,
14691462 pass_fds , cwd , env ,
@@ -1491,7 +1484,7 @@ def _execute_child(self, args, executable, preexec_fn, close_fds,
14911484 executable = args [0 ]
14921485
14931486 if (_USE_POSIX_SPAWN
1494- and ( _HAVE_POSIX_SPAWNP or os .path .dirname (executable ) )
1487+ and os .path .dirname (executable )
14951488 and preexec_fn is None
14961489 and not close_fds
14971490 and not pass_fds
0 commit comments