aboutsummaryrefslogtreecommitdiffstats
path: root/ez_setup.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-12-15 21:31:04 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-12-15 21:31:04 -0500
commit70fb4bec6c4a8fd5cb82cab29efb4a2ce8d227b0 (patch)
tree3f95f31ec1edf487ff96f523d138c3db0d555489 /ez_setup.py
parent5919897c159a1d5b093107dde380f3c1c81f356a (diff)
downloadexternal_python_setuptools-70fb4bec6c4a8fd5cb82cab29efb4a2ce8d227b0.tar.gz
external_python_setuptools-70fb4bec6c4a8fd5cb82cab29efb4a2ce8d227b0.tar.bz2
external_python_setuptools-70fb4bec6c4a8fd5cb82cab29efb4a2ce8d227b0.zip
Restore Python 2.7 compatibility
Diffstat (limited to 'ez_setup.py')
-rw-r--r--ez_setup.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/ez_setup.py b/ez_setup.py
index d8c3305e..1320ac92 100644
--- a/ez_setup.py
+++ b/ez_setup.py
@@ -346,7 +346,11 @@ def _resolve_version(version):
resp = urlopen('https://pypi.python.org/pypi/setuptools/json')
with contextlib.closing(resp):
- charset = resp.info().get_content_charset()
+ try:
+ charset = resp.info().get_content_charset()
+ except Exception:
+ # Python 2 compat; assume UTF-8
+ charset = 'UTF-8'
reader = codecs.getreader(charset)
doc = json.load(reader(resp))