summaryrefslogtreecommitdiff
path: root/setuptools/command/upload_docs.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-08-16 00:29:24 -0400
committerJason R. Coombs <jaraco@jaraco.com>2020-08-16 07:15:18 -0400
commitfb7ab81a3d080422687bad71f9ae9d36eeefbee2 (patch)
treed87a9f6fdf32ab64334e1eb8a695949a88a3b043 /setuptools/command/upload_docs.py
parent4eb5b32f8d8bb1e20907028a516346e2b1901391 (diff)
downloadpython-setuptools-git-fb7ab81a3d080422687bad71f9ae9d36eeefbee2.tar.gz
Remove Python 2 compatibility
Diffstat (limited to 'setuptools/command/upload_docs.py')
-rw-r--r--setuptools/command/upload_docs.py16
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)