Commit 4c4b9306 authored by Tarek Ziade's avatar Tarek Ziade

proper fix to avoid a syntax error on 2.5

--HG--
branch : distribute
extra : rebase_source : 320da069dcb5d4c3ffb94e6e4f0e78a1bef8a305
parent b14e668b
......@@ -91,8 +91,8 @@ class upload_docs(upload):
credentials = self.username + ':' + self.password
try: # base64 only works with bytes in Python 3.
encoded_creds = base64.encodebytes(credentials.encode('utf8'))
auth = b"Basic "
except (AttributeError, SyntaxError):
auth = bytes("Basic ")
except AttributeError:
encoded_creds = base64.encodestring(credentials)
auth = "Basic "
auth += encoded_creds.strip()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment