diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2015-11-17 17:19:48 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-11-17 17:19:48 -0500 |
commit | 087279f5bba984eb9758984b75a8e3a0dad914ad (patch) | |
tree | 1ef5166aabddc872ee9320771e03cb4e19fadebb | |
parent | 6c37006e3bf61ab05ca3a5cd5e0c9aed93c682e5 (diff) | |
download | python-setuptools-bitbucket-087279f5bba984eb9758984b75a8e3a0dad914ad.tar.gz |
Remove unnecessary __init__
-rw-r--r-- | scripts/upload-old-releases-as-zip.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/upload-old-releases-as-zip.py b/scripts/upload-old-releases-as-zip.py index c7c89fa7..1a638720 100644 --- a/scripts/upload-old-releases-as-zip.py +++ b/scripts/upload-old-releases-as-zip.py @@ -14,6 +14,7 @@ import os import shutil import tarfile import tempfile +import codecs import urllib.request import urllib.parse import urllib.error @@ -32,7 +33,6 @@ class SetuptoolsOldReleasesWithoutZip(object): """docstring for SetuptoolsOldReleases""" def __init__(self): - super(SetuptoolsOldReleasesWithoutZip, self).__init__() self.dirpath = tempfile.mkdtemp(prefix=DISTRIBUTION) print("Downloading %s releases..." % DISTRIBUTION) print("All releases will be downloaded to %s" % self.dirpath) @@ -117,7 +117,10 @@ class SetuptoolsOldReleasesWithoutZip(object): ], """ url = "https://pypi.python.org/pypi/%s/json" % (package_name,) - data = json.load(urllib.request.urlopen(urllib.request.Request(url))) + resp = urllib.request.urlopen(urllib.request.Request(url)) + charset = resp.info().get_content_charset() + reader = codecs.getreader(charset)(resp) + data = json.load(reader) # Mainly for debug. json_filename = "%s/%s.json" % (self.dirpath, DISTRIBUTION) |