diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2014-07-05 21:17:52 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-07-05 21:17:52 -0400 |
commit | 96aed21b42121acde68dd6b3732c3fbae0903569 (patch) | |
tree | 917f186172e1366ee5fa5069e59fee4cccd1d940 /setuptools | |
parent | d60e79a3daab4489a502842b49528c93ba5b1257 (diff) | |
download | external_python_setuptools-96aed21b42121acde68dd6b3732c3fbae0903569.tar.gz external_python_setuptools-96aed21b42121acde68dd6b3732c3fbae0903569.tar.bz2 external_python_setuptools-96aed21b42121acde68dd6b3732c3fbae0903569.zip |
Correct incorrect module for urllib.errors
--HG--
branch : feature/issue-229
extra : rebase_source : 93a1adbc64455d9cf7c3c8cceb7bbd283c06ac5b
Diffstat (limited to 'setuptools')
-rwxr-xr-x | setuptools/package_index.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/setuptools/package_index.py b/setuptools/package_index.py index 9c899218..a14c8ac6 100755 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -315,7 +315,7 @@ class PackageIndex(Environment): base = f.url # handle redirects page = f.read() if not isinstance(page, str): # We are in Python 3 and got bytes. We want str. - if isinstance(f, urllib.request.HTTPError): + if isinstance(f, urllib.error.HTTPError): # Errors have no charset, assume latin1: charset = 'latin-1' else: @@ -666,7 +666,7 @@ class PackageIndex(Environment): try: checker = HashChecker.from_url(url) fp = self.open_url(strip_fragment(url)) - if isinstance(fp, urllib.request.HTTPError): + if isinstance(fp, urllib.error.HTTPError): raise DistutilsError( "Can't download %s: %s %s" % (url, fp.code,fp.msg) ) @@ -709,10 +709,10 @@ class PackageIndex(Environment): self.warn(warning, msg) else: raise DistutilsError('%s %s' % (url, msg)) - except urllib.request.HTTPError: + except urllib.error.HTTPError: v = sys.exc_info()[1] return v - except urllib.request.URLError: + except urllib.error.URLError: v = sys.exc_info()[1] if warning: self.warn(warning, v.reason) |