diff options
author | Christian Heimes <christian@python.org> | 2022-04-01 19:20:56 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-01 19:20:56 (GMT) |
commit | 082d3495d0c820972f09f6109a98ed7eb5a7b79f (patch) | |
tree | a18d8ff8a87bdc5ad7e6f106dd895c73cedc9556 /Lib/subprocess.py | |
parent | 76b8a075b8a79b08468fd0ed06a489a5c815bc11 (diff) | |
download | cpython-082d3495d0c820972f09f6109a98ed7eb5a7b79f.zip cpython-082d3495d0c820972f09f6109a98ed7eb5a7b79f.tar.gz cpython-082d3495d0c820972f09f6109a98ed7eb5a7b79f.tar.bz2 |
bpo-40280: Emscripten fork_exec now fails early (GH-32224)
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r-- | Lib/subprocess.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py index ad08339..b58c578 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -96,7 +96,13 @@ if _mswindows: "CREATE_NO_WINDOW", "DETACHED_PROCESS", "CREATE_DEFAULT_ERROR_MODE", "CREATE_BREAKAWAY_FROM_JOB"]) else: - import _posixsubprocess + if sys.platform in {"emscripten", "wasi"}: + def _fork_exec(*args, **kwargs): + raise OSError( + errno.ENOTSUP, f"{sys.platform} does not support processes." + ) + else: + from _posixsubprocess import fork_exec as _fork_exec import select import selectors @@ -1777,7 +1783,7 @@ class Popen: for dir in os.get_exec_path(env)) fds_to_keep = set(pass_fds) fds_to_keep.add(errpipe_write) - self.pid = _posixsubprocess.fork_exec( + self.pid = _fork_exec( args, executable_list, close_fds, tuple(sorted(map(int, fds_to_keep))), cwd, env_list, |