aboutsummaryrefslogtreecommitdiffstats
path: root/ez_setup.py
diff options
context:
space:
mode:
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))