Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Lib/ensurepip/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,16 @@ 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,
# run pip interpreter in isolated mode if current interpreter was isolated
Comment thread
kcdodd marked this conversation as resolved.
Outdated
*( [ '-I', ] if sys.flags.isolated else [] ),
Comment thread
kcdodd marked this conversation as resolved.
Outdated
'-W', 'ignore::DeprecationWarning',
'-c',
code ]

return subprocess.run( cmd, check = True ).returncode


def version():
Expand Down