Commit 7b7e4db5 authored by tarek's avatar tarek

added a new option to drive the fakery when use_setuptools is called

--HG--
branch : distribute
extra : rebase_source : db0801762e31ee9414bbf6bca078681ce2b9b955
parent 0bb32764
...@@ -124,7 +124,7 @@ def _do_download(version, download_base, to_dir, download_delay): ...@@ -124,7 +124,7 @@ def _do_download(version, download_base, to_dir, download_delay):
def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
to_dir=os.curdir, download_delay=15): to_dir=os.curdir, download_delay=15, no_fake=False):
# making sure we use the absolute path # making sure we use the absolute path
to_dir = os.path.abspath(to_dir) to_dir = os.path.abspath(to_dir)
was_imported = 'pkg_resources' in sys.modules or \ was_imported = 'pkg_resources' in sys.modules or \
...@@ -133,7 +133,8 @@ def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, ...@@ -133,7 +133,8 @@ def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
try: try:
import pkg_resources import pkg_resources
if not hasattr(pkg_resources, '_distribute'): if not hasattr(pkg_resources, '_distribute'):
fake_setuptools() if not no_fake:
fake_setuptools()
raise ImportError raise ImportError
except ImportError: except ImportError:
return _do_download(version, download_base, to_dir, download_delay) return _do_download(version, download_base, to_dir, download_delay)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment