Commit c0b64234 authored by Yusei Tahara's avatar Yusei Tahara

easy_install.py: Upload index only if http status code is 2xx.

parent da782167
...@@ -216,7 +216,8 @@ class AllowHostsPackageIndex(setuptools.package_index.PackageIndex): ...@@ -216,7 +216,8 @@ class AllowHostsPackageIndex(setuptools.package_index.PackageIndex):
if nc.get('upload-cache-url') \ if nc.get('upload-cache-url') \
and nc.get('upload-dir-url') \ and nc.get('upload-dir-url') \
and '==' in requirement \ and '==' in requirement \
and getattr(f, 'code', None) != 404: and str(getattr(f, 'code', None)).startswith('2'):
# http status code is 2xx
upload_index_network_cached( upload_index_network_cached(
nc.get('upload-dir-url'), nc.get('upload-dir-url'),
nc.get('upload-cache-url'), nc.get('upload-cache-url'),
......
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