Commit 70fb4bec authored by Jason R. Coombs's avatar Jason R. Coombs

Restore Python 2.7 compatibility

parent 5919897c
......@@ -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))
......
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