mirror of
https://github.com/python/cpython.git
synced 2025-09-02 23:18:25 +00:00
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.
This commit is contained in:
parent
be07edf511
commit
5876063d06
1 changed files with 2 additions and 1 deletions
|
@ -35,11 +35,12 @@ const settings = {
|
||||||
mountDirectories(Module);
|
mountDirectories(Module);
|
||||||
Module.FS.chdir(process.cwd());
|
Module.FS.chdir(process.cwd());
|
||||||
Object.assign(Module.ENV, process.env);
|
Object.assign(Module.ENV, process.env);
|
||||||
|
delete Module.ENV.PATH;
|
||||||
},
|
},
|
||||||
// Ensure that sys.executable, sys._base_executable, etc point to python.sh
|
// 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
|
// not to this file. To properly handle symlinks, python.sh needs to compute
|
||||||
// its own path.
|
// 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.
|
// After python.sh come the arguments thatthe user passed to python.sh.
|
||||||
arguments: process.argv.slice(thisProgramIndex + 1),
|
arguments: process.argv.slice(thisProgramIndex + 1),
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue