mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Better fix for 'pip' detection in setup.py
This commit is contained in:
parent
1572064fef
commit
7d5441e294
1 changed files with 2 additions and 1 deletions
3
setup.py
3
setup.py
|
@ -20,10 +20,11 @@ if setup_dirname != '':
|
|||
os.chdir(setup_dirname)
|
||||
|
||||
# Use setuptools only if the user opts-in by setting the USE_SETUPTOOLS env var
|
||||
# Or if setuptools was previously imported (which is the case when using 'distribute')
|
||||
# This ensures consistent behavior but allows for advanced usage with
|
||||
# virtualenv, buildout, and others.
|
||||
with_setuptools = False
|
||||
if 'USE_SETUPTOOLS' in os.environ or 'pip' in __file__:
|
||||
if 'USE_SETUPTOOLS' in os.environ or 'setuptools' in sys.modules:
|
||||
try:
|
||||
from setuptools import setup
|
||||
from setuptools.command.install import install
|
||||
|
|
Loading…
Add table
Reference in a new issue