diff options
| author | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-08-16 12:34:46 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-16 12:34:46 +0000 |
| commit | f991fbb3c9d0e10a0a78ae2b508b3fd99f9cdef2 (patch) | |
| tree | a044b31a3276cc4a51b7fc23776a32b380562bad /setuptools/command/upload_docs.py | |
| parent | 4eb5b32f8d8bb1e20907028a516346e2b1901391 (diff) | |
| parent | 45e0ea0ff10a64f315a5c65b6805327222e5b565 (diff) | |
| download | python-setuptools-git-f991fbb3c9d0e10a0a78ae2b508b3fd99f9cdef2.tar.gz | |
Merge pull request #2332 from pypa/debt/cleanup-py2
Remove legacy Python 2 code
Diffstat (limited to 'setuptools/command/upload_docs.py')
| -rw-r--r-- | setuptools/command/upload_docs.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/setuptools/command/upload_docs.py b/setuptools/command/upload_docs.py index 0351da77..2559458a 100644 --- a/setuptools/command/upload_docs.py +++ b/setuptools/command/upload_docs.py @@ -15,17 +15,15 @@ import tempfile import shutil import itertools import functools - -from setuptools.extern import six -from setuptools.extern.six.moves import http_client, urllib +import http.client +import urllib.parse from pkg_resources import iter_entry_points from .upload import upload def _encode(s): - errors = 'strict' if six.PY2 else 'surrogateescape' - return s.encode('utf-8', errors) + return s.encode('utf-8', 'surrogateescape') class upload_docs(upload): @@ -152,9 +150,7 @@ class upload_docs(upload): } # set up the authentication credentials = _encode(self.username + ':' + self.password) - credentials = standard_b64encode(credentials) - if not six.PY2: - credentials = credentials.decode('ascii') + credentials = standard_b64encode(credentials).decode('ascii') auth = "Basic " + credentials body, ct = self._build_multipart(data) @@ -169,9 +165,9 @@ class upload_docs(upload): urllib.parse.urlparse(self.repository) assert not params and not query and not fragments if schema == 'http': - conn = http_client.HTTPConnection(netloc) + conn = http.client.HTTPConnection(netloc) elif schema == 'https': - conn = http_client.HTTPSConnection(netloc) + conn = http.client.HTTPSConnection(netloc) else: raise AssertionError("unsupported schema " + schema) |
