]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
*: Update black to newest version
authorBen Darnell <ben@bendarnell.com>
Sat, 31 Oct 2020 16:23:35 +0000 (12:23 -0400)
committerBen Darnell <ben@bendarnell.com>
Sat, 31 Oct 2020 16:23:35 +0000 (12:23 -0400)
12 files changed:
maint/requirements.in
maint/requirements.txt
tornado/http1connection.py
tornado/httputil.py
tornado/iostream.py
tornado/locks.py
tornado/platform/asyncio.py
tornado/template.py
tornado/test/tcpclient_test.py
tornado/web.py
tornado/websocket.py
tornado/wsgi.py

index 17dc3386009b639a9c42a9a49f8d5b5874d23759..12a6a5d825a58f09dbc5e55517d0244552f52285 100644 (file)
@@ -7,7 +7,7 @@
 # is the lockfile, and maint/requirements.in is the input file containing only
 # direct dependencies.
 
-black==19.10b0
+black
 flake8
 mypy==0.740
 tox
index a32e55f040dee26dd6107373c04b89908a7a7b78..39b7a4baddf705a813c8218bb19f94a81eb43bb9 100644 (file)
@@ -6,7 +6,7 @@
 # is the lockfile, and maint/requirements.in is the input file containing only
 # direct dependencies.
 
-black==19.10b0
+black==20.8b1
 flake8==3.8.4
 mypy==0.740
 tox==3.20.1
index 835027b479b7276dfd2c4ec1fc76af36901c1849..77b1cda7db0d4b6d102b86e7283a1f618c5af391 100644 (file)
@@ -69,8 +69,7 @@ class _ExceptionLoggingContext(object):
 
 
 class HTTP1ConnectionParameters(object):
-    """Parameters for `.HTTP1Connection` and `.HTTP1ServerConnection`.
-    """
+    """Parameters for `.HTTP1Connection` and `.HTTP1ServerConnection`."""
 
     def __init__(
         self,
@@ -703,8 +702,7 @@ class HTTP1Connection(httputil.HTTPConnection):
 
 
 class _GzipMessageDelegate(httputil.HTTPMessageDelegate):
-    """Wraps an `HTTPMessageDelegate` to decode ``Content-Encoding: gzip``.
-    """
+    """Wraps an `HTTPMessageDelegate` to decode ``Content-Encoding: gzip``."""
 
     def __init__(self, delegate: httputil.HTTPMessageDelegate, chunk_size: int) -> None:
         self._delegate = delegate
index bd32cd0c49cc2e369eed7a5724a8f0402f3a227d..0eeb9349b466a5dd2736666eadba46173f2bdbc9 100644 (file)
@@ -602,8 +602,7 @@ class HTTPConnection(object):
         raise NotImplementedError()
 
     def finish(self) -> None:
-        """Indicates that the last body data has been written.
-        """
+        """Indicates that the last body data has been written."""
         raise NotImplementedError()
 
 
index ced869bc4e80f113f017fca08c1e2e2787a506ca..768b404b1ba52edf7b6209941d1b6de53dcb0a16 100644 (file)
@@ -111,8 +111,7 @@ class UnsatisfiableReadError(Exception):
 
 
 class StreamBufferFullError(Exception):
-    """Exception raised by `IOStream` methods when the buffer is full.
-    """
+    """Exception raised by `IOStream` methods when the buffer is full."""
 
 
 class _StreamBuffer(object):
index 0898ebaa8baaa03432259d101ea92dc1a8fe9ffc..29b6b41299d08fc7c68e08815bd8b49e89877eca 100644 (file)
@@ -262,10 +262,10 @@ class Event(object):
 class _ReleasingContextManager(object):
     """Releases a Lock or Semaphore at the end of a "with" statement.
 
-        with (yield semaphore.acquire()):
-            pass
+    with (yield semaphore.acquire()):
+        pass
 
-        # Now semaphore.release() has been called.
+    # Now semaphore.release() has been called.
     """
 
     def __init__(self, obj: Any) -> None:
index 012948b3aa7d4db7604c91b84cb172140339113e..292d9b66a46b1ae9b99c94779983ce1bf61e162a 100644 (file)
@@ -463,7 +463,9 @@ class AddThreadSelectorEventLoop(asyncio.AbstractEventLoop):
         )  # type: Optional[Tuple[List[_FileDescriptorLike], List[_FileDescriptorLike]]]
         self._closing_selector = False
         self._thread = threading.Thread(
-            name="Tornado selector", daemon=True, target=self._run_select,
+            name="Tornado selector",
+            daemon=True,
+            target=self._run_select,
         )
         self._thread.start()
         # Start the select loop once the loop is started.
@@ -582,7 +584,9 @@ class AddThreadSelectorEventLoop(asyncio.AbstractEventLoop):
         self._start_select()
 
     def _handle_event(
-        self, fd: "_FileDescriptorLike", cb_map: Dict["_FileDescriptorLike", Callable],
+        self,
+        fd: "_FileDescriptorLike",
+        cb_map: Dict["_FileDescriptorLike", Callable],
     ) -> None:
         try:
             callback = cb_map[fd]
index 2e6e0a2fc58ea1fc1ed180a40d3ae83b4bab221d..d53e977c5e48d8e212a076b034abefd958a2548b 100644 (file)
@@ -451,8 +451,7 @@ class BaseLoader(object):
 
 
 class Loader(BaseLoader):
-    """A template loader that loads from a single root directory.
-    """
+    """A template loader that loads from a single root directory."""
 
     def __init__(self, root_directory: str, **kwargs: Any) -> None:
         super().__init__(**kwargs)
index 75f48186ec824e6d66b326f05667fe870b6438c2..2f7bdc104b85b3cc9a119c688fcc4235080fcaa6 100644 (file)
@@ -137,8 +137,7 @@ class TCPClientTest(AsyncTestCase):
             yield self.client.connect("127.0.0.1", port)
 
     def test_source_ip_fail(self):
-        """Fail when trying to use the source IP Address '8.8.8.8'.
-        """
+        """Fail when trying to use the source IP Address '8.8.8.8'."""
         self.assertRaises(
             socket.error,
             self.do_test_connect,
@@ -148,14 +147,12 @@ class TCPClientTest(AsyncTestCase):
         )
 
     def test_source_ip_success(self):
-        """Success when trying to use the source IP Address '127.0.0.1'.
-        """
+        """Success when trying to use the source IP Address '127.0.0.1'."""
         self.do_test_connect(socket.AF_INET, "127.0.0.1", source_ip="127.0.0.1")
 
     @skipIfNonUnix
     def test_source_port_fail(self):
-        """Fail when trying to use source port 1.
-        """
+        """Fail when trying to use source port 1."""
         if getpass.getuser() == "root":
             # Root can use any port so we can't easily force this to fail.
             # This is mainly relevant for docker.
index 546e6ecf118b1523641004c4be02b24799ed7ad7..59768ce2a759e5a222d2b9ba811e6fca658f9774 100644 (file)
@@ -1671,11 +1671,15 @@ class RequestHandler(object):
             )
             # If XSRF cookies are turned on, reject form submissions without
             # the proper cookie
-            if self.request.method not in (
-                "GET",
-                "HEAD",
-                "OPTIONS",
-            ) and self.application.settings.get("xsrf_cookies"):
+            if (
+                self.request.method
+                not in (
+                    "GET",
+                    "HEAD",
+                    "OPTIONS",
+                )
+                and self.application.settings.get("xsrf_cookies")
+            ):
                 self.check_xsrf_cookie()
 
             result = self.prepare()
index eef49e7c994f6103ead109a40ff61352ef812839..d2c6a427aacad25ac56248ddbabd588af03ec85f 100644 (file)
@@ -626,8 +626,7 @@ def _raise_not_supported_for_websockets(*args: Any, **kwargs: Any) -> None:
 
 
 class WebSocketProtocol(abc.ABC):
-    """Base class for WebSocket protocol versions.
-    """
+    """Base class for WebSocket protocol versions."""
 
     def __init__(self, handler: "_WebSocketDelegate") -> None:
         self.handler = handler
index 77124aaa309f58e14b8d4521ad5cc6daf75b3643..825b395cf5bb21abd0d62f68af62cd92dc213ca0 100644 (file)
@@ -146,8 +146,7 @@ class WSGIContainer(object):
 
     @staticmethod
     def environ(request: httputil.HTTPServerRequest) -> Dict[Text, Any]:
-        """Converts a `tornado.httputil.HTTPServerRequest` to a WSGI environment.
-        """
+        """Converts a `tornado.httputil.HTTPServerRequest` to a WSGI environment."""
         hostport = request.host.split(":")
         if len(hostport) == 2:
             host = hostport[0]