summaryrefslogtreecommitdiff
path: root/setuptools/command/upload_docs.py
diff options
context:
space:
mode:
authorHugo <hugovk@users.noreply.github.com>2020-01-08 19:10:11 +0200
committerHugo <hugovk@users.noreply.github.com>2020-01-08 19:10:11 +0200
commit796abd8dbec884cedf326cb5f85512a5d5648c4e (patch)
treecacbbdc28822b519f87b679a8262687421d13c01 /setuptools/command/upload_docs.py
parent7e97def47723303fafabe48b22168bbc11bb4821 (diff)
downloadpython-setuptools-git-796abd8dbec884cedf326cb5f85512a5d5648c4e.tar.gz
Fix for Python 4: replace unsafe six.PY3 with PY2
Diffstat (limited to 'setuptools/command/upload_docs.py')
-rw-r--r--setuptools/command/upload_docs.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/setuptools/command/upload_docs.py b/setuptools/command/upload_docs.py
index 07aa564a..130a0cb6 100644
--- a/setuptools/command/upload_docs.py
+++ b/setuptools/command/upload_docs.py
@@ -24,7 +24,7 @@ from .upload import upload
def _encode(s):
- errors = 'surrogateescape' if six.PY3 else 'strict'
+ errors = 'strict' if six.PY2 else 'surrogateescape'
return s.encode('utf-8', errors)
@@ -153,7 +153,7 @@ class upload_docs(upload):
# set up the authentication
credentials = _encode(self.username + ':' + self.password)
credentials = standard_b64encode(credentials)
- if six.PY3:
+ if not six.PY2:
credentials = credentials.decode('ascii')
auth = "Basic " + credentials