diff options
author | Helmut Grohne <helmut@subdivi.de> | 2015-04-18 20:38:13 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2015-04-18 20:38:13 +0200 |
commit | 828d8f22ee3e785692d019ed02c4f7874792a8e9 (patch) | |
tree | b14886c4cca174d993ee7e882ea4f4ba3eabb55e /wsgitools/authentication.py | |
parent | 42f5ccf09799d3e475eb996b023a0daabae49cdb (diff) | |
parent | c1ba0c783fc59dc8d00b9b8aed7250569bcc14d4 (diff) | |
download | wsgitools-828d8f22ee3e785692d019ed02c4f7874792a8e9.tar.gz |
Merge branch py3k
Diffstat (limited to 'wsgitools/authentication.py')
-rw-r--r-- | wsgitools/authentication.py | 6 |
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)))] |