diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2015-12-15 21:31:04 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-12-15 21:31:04 -0500 |
| commit | 70fb4bec6c4a8fd5cb82cab29efb4a2ce8d227b0 (patch) | |
| tree | 3f95f31ec1edf487ff96f523d138c3db0d555489 | |
| parent | 5919897c159a1d5b093107dde380f3c1c81f356a (diff) | |
| download | python-setuptools-git-70fb4bec6c4a8fd5cb82cab29efb4a2ce8d227b0.tar.gz | |
Restore Python 2.7 compatibility
| -rw-r--r-- | ez_setup.py | 6 |
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)) |
