diff options
author | Hood Chatham <roberthoodchatham@gmail.com> | 2024-12-09 02:01:37 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-09 02:01:37 (GMT) |
commit | 5876063d06ec55b10793f34bfe516c10f608665c (patch) | |
tree | df5e77a4ec918ffd65cb1a276abea64c7464ec23 /Tools/wasm | |
parent | be07edf511365ce554c0535b535bb5726266a17a (diff) | |
download | cpython-5876063d06ec55b10793f34bfe516c10f608665c.zip cpython-5876063d06ec55b10793f34bfe516c10f608665c.tar.gz cpython-5876063d06ec55b10793f34bfe516c10f608665c.tar.bz2 |
gh-127503 Don't propagate native PATH to Emscripten Python (#127633)
Modifies the handling of PATH to ensure that native executables aren't picked
up when running under node.
Diffstat (limited to 'Tools/wasm')
-rw-r--r-- | Tools/wasm/emscripten/node_entry.mjs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Tools/wasm/emscripten/node_entry.mjs b/Tools/wasm/emscripten/node_entry.mjs index 40ab151..98b8f57 100644 --- a/Tools/wasm/emscripten/node_entry.mjs +++ b/Tools/wasm/emscripten/node_entry.mjs @@ -35,11 +35,12 @@ const settings = { mountDirectories(Module); Module.FS.chdir(process.cwd()); Object.assign(Module.ENV, process.env); + delete Module.ENV.PATH; }, // Ensure that sys.executable, sys._base_executable, etc point to python.sh // not to this file. To properly handle symlinks, python.sh needs to compute // its own path. - thisProgram: process.argv[thisProgramIndex], + thisProgram: process.argv[thisProgramIndex].slice(thisProgram.length), // After python.sh come the arguments thatthe user passed to python.sh. arguments: process.argv.slice(thisProgramIndex + 1), }; |