Skip to content

Commit 46d284e

Browse files
committed
Fix lint errors
1 parent 1d9a89b commit 46d284e

4 files changed

Lines changed: 19 additions & 34 deletions

File tree

src/webob/exc.py

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -238,23 +238,18 @@ class WSGIHTTPException(Response, HTTPException):
238238
code = 500
239239
title = "Internal Server Error"
240240
explanation = ""
241-
body_template_obj = Template(
242-
"""\
241+
body_template_obj = Template("""\
243242
${explanation}<br /><br />
244243
${detail}
245244
${html_comment}
246-
"""
247-
)
245+
""")
248246

249-
plain_template_obj = Template(
250-
"""\
247+
plain_template_obj = Template("""\
251248
${status}
252249
253-
${body}"""
254-
)
250+
${body}""")
255251

256-
html_template_obj = Template(
257-
"""\
252+
html_template_obj = Template("""\
258253
<html>
259254
<head>
260255
<title>${status}</title>
@@ -263,8 +258,7 @@ class WSGIHTTPException(Response, HTTPException):
263258
<h1>${status}</h1>
264259
${body}
265260
</body>
266-
</html>"""
267-
)
261+
</html>""")
268262

269263
# Set this to True for responses that should have no request body
270264
empty_body = False
@@ -543,13 +537,11 @@ class _HTTPMove(HTTPRedirection):
543537
"""
544538

545539
explanation = "The resource has been moved to"
546-
body_template_obj = Template(
547-
"""\
540+
body_template_obj = Template("""\
548541
${explanation} <a href="${location}">${location}</a>;
549542
you should be redirected automatically.
550543
${detail}
551-
${html_comment}"""
552-
)
544+
${html_comment}""")
553545

554546
def __init__(
555547
self,
@@ -820,11 +812,9 @@ class HTTPMethodNotAllowed(HTTPClientError):
820812
code = 405
821813
title = "Method Not Allowed"
822814
# override template since we need an environment variable
823-
body_template_obj = Template(
824-
"""\
815+
body_template_obj = Template("""\
825816
The method ${REQUEST_METHOD} is not allowed for this resource. <br /><br />
826-
${detail}"""
827-
)
817+
${detail}""")
828818

829819

830820
class HTTPNotAcceptable(HTTPClientError):
@@ -842,12 +832,10 @@ class HTTPNotAcceptable(HTTPClientError):
842832
code = 406
843833
title = "Not Acceptable"
844834
# override template since we need an environment variable
845-
body_template_obj = Template(
846-
"""\
835+
body_template_obj = Template("""\
847836
The resource could not be generated that was acceptable to your browser
848837
(content of type ${HTTP_ACCEPT}. <br /><br />
849-
${detail}"""
850-
)
838+
${detail}""")
851839

852840

853841
class HTTPProxyAuthenticationRequired(HTTPClientError):
@@ -991,12 +979,10 @@ class HTTPUnsupportedMediaType(HTTPClientError):
991979
code = 415
992980
title = "Unsupported Media Type"
993981
# override template since we need an environment variable
994-
body_template_obj = Template(
995-
"""\
982+
body_template_obj = Template("""\
996983
The request media type ${CONTENT_TYPE} is not supported by this server.
997984
<br /><br />
998-
${detail}"""
999-
)
985+
${detail}""")
1000986

1001987

1002988
class HTTPRequestRangeNotSatisfiable(HTTPClientError):
@@ -1199,11 +1185,9 @@ class HTTPNotImplemented(HTTPServerError):
11991185

12001186
code = 501
12011187
title = "Not Implemented"
1202-
body_template_obj = Template(
1203-
"""
1188+
body_template_obj = Template("""
12041189
The request method ${REQUEST_METHOD} is not implemented for this server. <br /><br />
1205-
${detail}"""
1206-
)
1190+
${detail}""")
12071191

12081192

12091193
class HTTPBadGateway(HTTPServerError):

src/webob/multidict.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"""
55
Gives a multi-value dictionary object (MultiDict) plus several wrappers
66
"""
7+
78
import binascii
89
from collections.abc import MutableMapping
910
from urllib.parse import urlencode as url_encode

src/webob/response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ def from_file(cls, fp):
352352
_http = b"HTTP/"
353353

354354
if status.startswith(_http):
355-
(http_ver, status_num, status_text) = status.split(None, 2)
355+
http_ver, status_num, status_text = status.split(None, 2)
356356
status = f"{text_(status_num)} {text_(status_text)}"
357357

358358
while 1:

tests/test_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ def dummy_wsgi_callable(environ, start_response):
10521052
environ = {}
10531053

10541054
def dummy_start_response(status, headers, exc_info=None):
1055-
assert headers, [("Set-Cookie" == "a=1; Path=/")]
1055+
assert headers, ["Set-Cookie" == "a=1; Path=/"]
10561056

10571057
result = wsgiapp(environ, dummy_start_response)
10581058
assert result == "abc"

0 commit comments

Comments
 (0)