Skip to content
Snippets Groups Projects
Unverified Commit c8556bcf authored by Carter Dodd's avatar Carter Dodd Committed by GitHub
Browse files

gh-90355: Add isolated flag if currently isolated (GH-92857)


Co-authored-by: default avatarÉric <merwok@netwok.org>
Co-authored-by: default avatarŁukasz Langa <lukasz@langa.pl>
parent 06759752
Branches
Tags
No related merge requests found
......@@ -89,8 +89,18 @@ def _run_pip(args, additional_paths=None):
sys.argv[1:] = {args}
runpy.run_module("pip", run_name="__main__", alter_sys=True)
"""
return subprocess.run([sys.executable, '-W', 'ignore::DeprecationWarning',
"-c", code], check=True).returncode
cmd = [
sys.executable,
'-W',
'ignore::DeprecationWarning',
'-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():
......
Fix :mod:`ensurepip` environment isolation for subprocess running ``pip``.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment