]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
http1connection: Fix some weird formatting 2529/head
authorBen Darnell <ben@bendarnell.com>
Fri, 2 Nov 2018 16:57:09 +0000 (12:57 -0400)
committerBen Darnell <ben@bendarnell.com>
Fri, 2 Nov 2018 16:57:09 +0000 (12:57 -0400)
`black` refused to move the operator across the comment, leaving it
stranded on a line by its own. The most recent version of pycodestyle
complains about this.

tornado/http1connection.py

index 41df9f2c19a6149f2cfa3467c94a7f778031fff9..10402b4bf29cb553252df519133f1ad56d551fc1 100644 (file)
@@ -403,19 +403,16 @@ class HTTP1Connection(httputil.HTTPConnection):
                 # self._request_start_line.version or
                 # start_line.version?
                 self._request_start_line.version == "HTTP/1.1"
-                and
                 # 1xx, 204 and 304 responses have no body (not even a zero-length
                 # body), and so should not have either Content-Length or
                 # Transfer-Encoding headers.
-                start_line.code not in (204, 304)
+                and start_line.code not in (204, 304)
                 and (start_line.code < 100 or start_line.code >= 200)
-                and
                 # No need to chunk the output if a Content-Length is specified.
-                "Content-Length" not in headers
-                and
+                and "Content-Length" not in headers
                 # Applications are discouraged from touching Transfer-Encoding,
                 # but if they do, leave it alone.
-                "Transfer-Encoding" not in headers
+                and "Transfer-Encoding" not in headers
             )
             # If connection to a 1.1 client will be closed, inform client
             if (