summaryrefslogtreecommitdiff
path: root/wsgitools/authentication.py
diff options
context:
space:
mode:
Diffstat (limited to 'wsgitools/authentication.py')
-rw-r--r--wsgitools/authentication.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/wsgitools/authentication.py b/wsgitools/authentication.py
index c39c018..59747e0 100644
--- a/wsgitools/authentication.py
+++ b/wsgitools/authentication.py
@@ -64,7 +64,7 @@ class AuthenticationMiddleware(object):
raise AuthenticationRequired(
"authorization method not implemented: %r" % method)
result = self.authenticate(rest, environ)
- except AuthenticationRequired, exc:
+ except AuthenticationRequired as exc:
return self.authorization_required(environ, start_response, exc)
assert isinstance(result, dict)
assert "user" in result
@@ -97,8 +97,8 @@ class AuthenticationMiddleware(object):
@param exception: reason for the authentication failure
"""
status = "401 Authorization required"
- html = "<html><head><title>401 Authorization required</title></head>" \
- "<body><h1>401 Authorization required</h1></body></html>"
+ html = b"<html><head><title>401 Authorization required</title></head>" \
+ b"<body><h1>401 Authorization required</h1></body></html>"
headers = [("Content-Type", "text/html"),
self.www_authenticate(exception),
("Content-Length", str(len(html)))]