summaryrefslogtreecommitdiffstats
path: root/Lib/subprocess.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-01-16 22:38:06 (GMT)
committerGitHub <noreply@github.com>2019-01-16 22:38:06 (GMT)
commit8c349565e8a442e17f1a954d1a9996847749d778 (patch)
treeafcf4294d4949a59dc2d3383e11b5c2b91970597 /Lib/subprocess.py
parent07858894689047c77f9c12ddc061d30681368d19 (diff)
downloadcpython-8c349565e8a442e17f1a954d1a9996847749d778.zip
cpython-8c349565e8a442e17f1a954d1a9996847749d778.tar.gz
cpython-8c349565e8a442e17f1a954d1a9996847749d778.tar.bz2
Revert "bpo-35537: subprocess can now use os.posix_spawnp (GH-11579)" (GH-11582)
This reverts commit 07858894689047c77f9c12ddc061d30681368d19.
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r--Lib/subprocess.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index d63cf20..b94575b 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -655,7 +655,6 @@ def _use_posix_spawn():
_USE_POSIX_SPAWN = _use_posix_spawn()
-_HAVE_POSIX_SPAWNP = hasattr(os, 'posix_spawnp')
class Popen(object):
@@ -1443,10 +1442,7 @@ class Popen(object):
def _posix_spawn(self, args, executable, env, restore_signals):
- """Execute program using os.posix_spawnp().
-
- Or use os.posix_spawn() if os.posix_spawnp() is not available.
- """
+ """Execute program using os.posix_spawn()."""
if env is None:
env = os.environ
@@ -1460,10 +1456,7 @@ class Popen(object):
sigset.append(signum)
kwargs['setsigdef'] = sigset
- if _HAVE_POSIX_SPAWNP:
- self.pid = os.posix_spawnp(executable, args, env, **kwargs)
- else:
- self.pid = os.posix_spawn(executable, args, env, **kwargs)
+ self.pid = os.posix_spawn(executable, args, env, **kwargs)
def _execute_child(self, args, executable, preexec_fn, close_fds,
pass_fds, cwd, env,
@@ -1491,7 +1484,7 @@ class Popen(object):
executable = args[0]
if (_USE_POSIX_SPAWN
- and (_HAVE_POSIX_SPAWNP or os.path.dirname(executable))
+ and os.path.dirname(executable)
and preexec_fn is None
and not close_fds
and not pass_fds