]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Simplify chained comparison. 2750/head
authorJohn Bampton <jbampton@users.noreply.github.com>
Sun, 6 Oct 2019 02:44:52 +0000 (12:44 +1000)
committerJohn Bampton <jbampton@users.noreply.github.com>
Sun, 6 Oct 2019 03:05:58 +0000 (13:05 +1000)
tornado/http1connection.py
tornado/web.py

index 9b40fd6539b7cd27a05166d97082a54a78672ef9..826f6f3047e47dc1774bd0cd6aed1751ad0fad44 100644 (file)
@@ -235,7 +235,7 @@ class HTTP1Connection(httputil.HTTPConnection):
                     # but do not actually have a body.
                     # http://tools.ietf.org/html/rfc7230#section-3.3
                     skip_body = True
-                if code >= 100 and code < 200:
+                if 100 <= code < 200:
                     # 1xx responses should never indicate the presence of
                     # a body.
                     if "Content-Length" in headers or "Transfer-Encoding" in headers:
index adbf591e50283b845ee30843485483534c85ce37..751ed1e41be672dd35d4efe9bb5c240ecc0dad6e 100644 (file)
@@ -1132,9 +1132,7 @@ class RequestHandler(object):
                 if self.check_etag_header():
                     self._write_buffer = []
                     self.set_status(304)
-            if self._status_code in (204, 304) or (
-                self._status_code >= 100 and self._status_code < 200
-            ):
+            if self._status_code in (204, 304) or (100 <= self._status_code < 200):
                 assert not self._write_buffer, (
                     "Cannot send body with %s" % self._status_code
                 )