mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Return pip binary without -m flag when not using python
This commit is contained in:
parent
10d4f8b1a7
commit
158762bd5e
1 changed files with 7 additions and 3 deletions
|
@ -87,7 +87,7 @@ import shutil
|
|||
import sys
|
||||
import tempfile
|
||||
|
||||
import pkg_resources
|
||||
import pkg_resources # pylint: disable=3rd-party-module-not-gated
|
||||
|
||||
# Import Salt libs
|
||||
import salt.utils.data
|
||||
|
@ -150,8 +150,12 @@ def _get_pip_bin(bin_env):
|
|||
executable itself, or from searching conventional filesystem locations
|
||||
"""
|
||||
if not bin_env:
|
||||
logger.debug("pip: Using pip from currently-running Python")
|
||||
return [os.path.normpath(sys.executable), "-m", "pip"]
|
||||
if "run" in os.path.normpath(sys.executable):
|
||||
logger.debug("pip: Using pip from run executable")
|
||||
return [os.path.normpath(sys.executable), "pip"]
|
||||
else:
|
||||
logger.debug("pip: Using pip from currently-running Python")
|
||||
return [os.path.normpath(sys.executable), "-m", "pip"]
|
||||
|
||||
python_bin = "python.exe" if salt.utils.platform.is_windows() else "python"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue