aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/package_index.py
diff options
context:
space:
mode:
Diffstat (limited to 'setuptools/package_index.py')
-rwxr-xr-xsetuptools/package_index.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/setuptools/package_index.py b/setuptools/package_index.py
index 1f9b6bd8..4ff96303 100755
--- a/setuptools/package_index.py
+++ b/setuptools/package_index.py
@@ -199,7 +199,7 @@ class PackageIndex(Environment):
base = f.url # handle redirects
page = f.read()
- if sys.version_info >= (3,):
+ if sys.version_info >= (3,) and not isinstance(f, urllib2.HTTPError):
charset = f.headers.get_param('charset') or 'latin-1'
page = page.decode(charset, "ignore")
f.close()