mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Fix test_logger in Python 3.2.
This commit is contained in:
parent
da37bcfebe
commit
dddfcb2826
@ -378,7 +378,9 @@ class Logger(object):
|
||||
auth = http_auth.split(" ", 1)
|
||||
if len(auth) == 2:
|
||||
try:
|
||||
auth = base64.b64decode(auth[1].strip())
|
||||
# b64decode doesn't accept unicode in Python < 3.3
|
||||
# so we need to convert it to a byte string
|
||||
auth = base64.b64decode(auth[1].strip().encode('utf-8'))
|
||||
if PY3: # b64decode returns a byte string in Python 3
|
||||
auth = auth.decode('utf-8')
|
||||
auth = auth.split(":", 1)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user