mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
[3.9] gh-90355: Add isolated flag if currently isolated (GH-92857) (GH-94570)
Co-authored-by: Carter Dodd <carter.dodd@gmail.com>
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit c8556bcf6c)
This commit is contained in:
parent
224cd0c3bf
commit
eff4aa5409
2 changed files with 7 additions and 1 deletions
|
|
@ -31,7 +31,12 @@ sys.path = {additional_paths or []} + sys.path
|
|||
sys.argv[1:] = {args}
|
||||
runpy.run_module("pip", run_name="__main__", alter_sys=True)
|
||||
"""
|
||||
return subprocess.run([sys.executable, "-c", code], check=True).returncode
|
||||
|
||||
cmd = [sys.executable, '-c', code]
|
||||
if sys.flags.isolated:
|
||||
# run code in isolated mode if currently running isolated
|
||||
cmd.insert(1, '-I')
|
||||
return subprocess.run(cmd, check=True).returncode
|
||||
|
||||
|
||||
def version():
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
Fix :mod:`ensurepip` environment isolation for subprocess running ``pip``.
|
||||
Loading…
Add table
Add a link
Reference in a new issue