Skip to content

Commit

Permalink
Fix setuptools url and curl wants --location to follow redirects
Browse files Browse the repository at this point in the history
This change also removes:

    sys.meta_path = [importer for importer in sys.meta_path if
                     importer.__class__.__module__ != 'pkg_resources.extern']

from _unload_pkg_resources.

These lines were removed from the version at: https://bootstrap.pypa.io/ez_setup.py

I don't know why the code there and here differs.
  • Loading branch information
Jim Fulton committed Apr 25, 2016
1 parent 005cb1d commit cf470e3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ez_setup.py
Expand Up @@ -33,7 +33,7 @@

LATEST = object()
DEFAULT_VERSION = LATEST
DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/"
DEFAULT_URL = "https://pypi.io/packages/source/s/setuptools/"

This comment has been minimized.

Copy link
@gforcada

gforcada May 6, 2016

@jimfulton as of today this makes non up-to-date bootstrap.py to fail as the URLs to get setuptools end up in different locations (in fact pypi.io returns a not found)

DEFAULT_SAVE_DIR = os.curdir


Expand Down Expand Up @@ -192,8 +192,6 @@ def _conflict_bail(VC_err, version):


def _unload_pkg_resources():
sys.meta_path = [importer for importer in sys.meta_path if
importer.__class__.__module__ != 'pkg_resources.extern']
del_modules = [
name for name in sys.modules
if name.startswith('pkg_resources')
Expand Down Expand Up @@ -253,7 +251,7 @@ def has_powershell():


def download_file_curl(url, target):
cmd = ['curl', url, '--silent', '--output', target]
cmd = ['curl', url, '--location', '--silent', '--output', target]
_clean_check(cmd, target)


Expand Down

0 comments on commit cf470e3

Please sign in to comment.