]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
*: Rewrite typing imports to use their new (3.9+) locations
authorBen Darnell <ben@bendarnell.com>
Thu, 19 Mar 2026 15:24:02 +0000 (11:24 -0400)
committerBen Darnell <ben@bendarnell.com>
Thu, 19 Mar 2026 15:24:02 +0000 (11:24 -0400)
Automated change by pyupgrade ("imports" plugin)

23 files changed:
tornado/auth.py
tornado/gen.py
tornado/http1connection.py
tornado/httpclient.py
tornado/httpserver.py
tornado/httputil.py
tornado/ioloop.py
tornado/iostream.py
tornado/locale.py
tornado/locks.py
tornado/netutil.py
tornado/options.py
tornado/platform/caresresolver.py
tornado/queues.py
tornado/routing.py
tornado/simple_httpclient.py
tornado/tcpclient.py
tornado/tcpserver.py
tornado/template.py
tornado/testing.py
tornado/util.py
tornado/web.py
tornado/websocket.py

index 907c260cfa152a375a51374740f4fca1b067011e..d041b5fc4771ae9e818cfafc75bdf2d93a0c6c79 100644 (file)
@@ -84,7 +84,8 @@ from tornado.httputil import url_concat
 from tornado.util import unicode_type
 from tornado.web import RequestHandler
 
-from typing import Any, cast, Iterable, Union, Optional
+from typing import Any, cast, Union, Optional
+from collections.abc import Iterable
 
 
 class AuthError(Exception):
index 9b2183058e307951a6272cda3a815d4ac216de89..2a2bb209286e53ad7567a436354f9716ae2ee52c 100644 (file)
@@ -92,21 +92,20 @@ except ImportError:
 
 import typing
 from typing import (
-    Mapping,
     Union,
     Any,
     Callable,
     List,
     Type,
     Tuple,
-    Awaitable,
     Dict,
-    Sequence,
     overload,
 )
+from collections.abc import Mapping, Awaitable, Sequence
 
 if typing.TYPE_CHECKING:
-    from typing import Deque, Optional, Set, Iterable  # noqa: F401
+    from typing import Deque, Optional, Set  # noqa: F401
+    from collections.abc import Iterable
 
 _T = typing.TypeVar("_T")
 
index cacc0c7e8fe03fd3fdc9cfdd616210af087d35f6..c41b82f908163363e5a184453d00211aa34ff1e1 100644 (file)
@@ -36,7 +36,8 @@ from tornado.log import gen_log, app_log
 from tornado.util import GzipDecompressor
 
 
-from typing import cast, Optional, Type, Awaitable, Callable, Union
+from typing import cast, Optional, Type, Callable, Union
+from collections.abc import Awaitable
 
 CR_OR_LF_RE = re.compile(b"\r|\n")
 
index 4c9cf98e9c197bb7a815b7476f94971d15b4e4a0..915b7deb8ef7948622aad776c0d7ad9c95c91928 100644 (file)
@@ -53,7 +53,8 @@ from tornado import gen, httputil
 from tornado.ioloop import IOLoop
 from tornado.util import Configurable
 
-from typing import Type, Any, Union, Callable, Optional, Awaitable, cast
+from typing import Type, Any, Union, Callable, Optional, cast
+from collections.abc import Awaitable
 
 
 class HTTPClient:
index a952fac8718075720a31a1848f0018f28c862a3e..d8ee9fadc52aa9244a1f99c46342fdf5e28378f9 100644 (file)
@@ -37,7 +37,8 @@ from tornado.tcpserver import TCPServer
 from tornado.util import Configurable
 
 import typing
-from typing import Union, Any, Callable, Optional, Awaitable
+from typing import Union, Any, Callable, Optional
+from collections.abc import Awaitable
 
 if typing.TYPE_CHECKING:
     from typing import Set  # noqa: F401
index 509245f74e2faec81c896575c98e91ba74c46a1e..ce239adcb90edb239dd2744c6605a7f74b13a90c 100644 (file)
@@ -45,13 +45,9 @@ responses
 
 import typing
 from typing import (
-    Iterable,
-    Mapping,
-    Iterator,
-    Awaitable,
-    Generator,
     AnyStr,
 )
+from collections.abc import Iterable, Mapping, Iterator, Awaitable, Generator
 
 if typing.TYPE_CHECKING:
     from typing import Deque  # noqa: F401
index a1b23e4a8472258e84b73cde9dfeb2dcc14b0cf7..defaaa102f016364a5d30f8cf74401ecdf267f4c 100644 (file)
@@ -49,7 +49,8 @@ from tornado.log import app_log
 from tornado.util import Configurable, TimeoutError, import_object
 
 import typing
-from typing import Any, Callable, TypeVar, Awaitable
+from typing import Any, Callable, TypeVar
+from collections.abc import Awaitable
 
 if typing.TYPE_CHECKING:
     from typing import Dict, List, Set, TypedDict  # noqa: F401
index 78161b1c1e4d6b5037aedefe0f209544b164dca0..a8ee7f39f787ad8a6786488f36d8b0e4afe53ff5 100644 (file)
@@ -44,12 +44,12 @@ import typing
 from typing import (
     Union,
     Optional,
-    Awaitable,
     Callable,
-    Pattern,
     Any,
     TypeVar,
 )
+from collections.abc import Awaitable
+from re import Pattern
 from types import TracebackType
 
 if typing.TYPE_CHECKING:
index ed071926d5ef4207ac2928c28e9cf73c5c8c8ff1..eb9899daaae20a1f01a6f83ae1837b940b6e3312 100644 (file)
@@ -52,7 +52,8 @@ from tornado.log import gen_log
 
 from tornado._locale_data import LOCALE_NAMES
 
-from typing import Iterable, Any
+from typing import Any
+from collections.abc import Iterable
 
 _default_locale = "en_US"
 _translations: dict[str, Any] = {}
index 2bb18eca6077d2fa72365aa498073a7fcb50a7a4..28cde94616d36e696e92007f59ffda2343376156 100644 (file)
@@ -19,7 +19,8 @@ import types
 from tornado import gen, ioloop
 from tornado.concurrent import Future, future_set_result_unless_cancelled
 
-from typing import Union, Optional, Type, Any, Awaitable
+from typing import Union, Optional, Type, Any
+from collections.abc import Awaitable
 import typing
 
 if typing.TYPE_CHECKING:
index c9a8a4cbeb68af61e95fdf1463989f84db9229d1..35f294e962ef559100b136b32f9127fcc6889943 100644 (file)
@@ -28,7 +28,8 @@ from tornado.concurrent import dummy_executor, run_on_executor
 from tornado.ioloop import IOLoop
 from tornado.util import Configurable, errno_from_exception
 
-from typing import Callable, Any, Union, Awaitable, Optional
+from typing import Callable, Any, Union, Optional
+from collections.abc import Awaitable
 
 # Note that the naming of ssl.Purpose is confusing; the purpose
 # of a context is to authenticate the opposite side of the connection.
index fe9f52f7569512646fe6f004c9aa8eb525d131c7..ee3f22140aa7c045e543bda6e04c6b3216e11e2d 100644 (file)
@@ -112,12 +112,11 @@ from tornado.util import basestring_type, exec_in
 
 from typing import (
     Any,
-    Iterator,
-    Iterable,
     Callable,
     TextIO,
     Optional,
 )
+from collections.abc import Iterator, Iterable
 
 
 class Error(Exception):
index 3945b9846e50df95bda06f02e1c98ac40081f1a3..fb2658e2314e5d3650f6b85075304106413524fb 100644 (file)
@@ -9,7 +9,8 @@ from tornado.netutil import Resolver, is_valid_ip
 import typing
 
 if typing.TYPE_CHECKING:
-    from typing import Generator, Any, List, Tuple, Dict  # noqa: F401
+    from typing import Any, List, Tuple, Dict  # noqa: F401
+    from collections.abc import Generator
 
 
 class CaresResolver(Resolver):
index 86eb27e8ecebb0b9a2d37997feece8e52df7ca77..ddaa8dce141f4f32e6bfe8e02281f25085e5af41 100644 (file)
@@ -35,7 +35,8 @@ from tornado import gen, ioloop
 from tornado.concurrent import Future, future_set_result_unless_cancelled
 from tornado.locks import Event
 
-from typing import TypeVar, Generic, Awaitable
+from typing import TypeVar, Generic
+from collections.abc import Awaitable
 import typing
 
 if typing.TYPE_CHECKING:
index 6c6a716633ccbd5f16bf3726c8eae5ecccdf3b6c..82c034c63b3028d72ed5c88e5733ab2b3294aaa8 100644 (file)
@@ -188,11 +188,10 @@ from typing import (
     Any,
     Union,
     Optional,
-    Awaitable,
-    Pattern,
     overload,
-    Sequence,
 )
+from collections.abc import Awaitable, Sequence
+from re import Pattern
 
 
 class Router(httputil.HTTPServerConnectionDelegate):
index 9d50ed9eef7fa243e1485f045cfef60bf8f76710..742678e64f3cfb8fb77cab9302368e72b39bd865 100644 (file)
@@ -33,7 +33,8 @@ import time
 from io import BytesIO
 import urllib.parse
 
-from typing import Any, Callable, Optional, Type, Union, Awaitable
+from typing import Any, Callable, Optional, Type, Union
+from collections.abc import Awaitable
 from types import TracebackType
 import typing
 
index 31defeb12ff0a6de9d5b98fe6a42046b774a7626..132dd5e40351398fb5002d2be6d2917402fd6065 100644 (file)
@@ -29,7 +29,8 @@ from tornado import gen
 from tornado.netutil import Resolver
 from tornado.gen import TimeoutError
 
-from typing import Any, Union, Tuple, Callable, Iterator, Optional
+from typing import Any, Union, Tuple, Callable, Optional
+from collections.abc import Iterator
 
 if typing.TYPE_CHECKING:
     from typing import Set  # noqa(F401)
index 4d760b45696c8b5514422845908d36fc3f1d6e19..a491a84884057254f1cb6c05ef4ede780e2d8412 100644 (file)
@@ -34,7 +34,8 @@ from tornado import process
 from tornado.util import errno_from_exception
 
 import typing
-from typing import Union, Any, Iterable, Optional, Awaitable
+from typing import Union, Any, Optional
+from collections.abc import Iterable, Awaitable
 
 if typing.TYPE_CHECKING:
     from typing import Callable, List  # noqa: F401
index 1a7153ec71ec8bbb354f5256f838fc3aedf6498d..03f33acc5458503a6b673b2073eebb8d672a0583 100644 (file)
@@ -208,7 +208,8 @@ from tornado import escape
 from tornado.log import app_log
 from tornado.util import ObjectDict, exec_in, unicode_type
 
-from typing import Any, Union, Callable, Iterable, Optional, TextIO
+from typing import Any, Union, Callable, Optional, TextIO
+from collections.abc import Iterable
 import typing
 
 if typing.TYPE_CHECKING:
index e3ac8df56ed33e94d047be40b8ac886b3a31cdd6..f4c7406fee2cf1b92be9201befdb1fa6cf8c7476 100644 (file)
@@ -34,7 +34,8 @@ from tornado.util import raise_exc_info, basestring_type
 from tornado.web import Application
 
 import typing
-from typing import Any, Callable, Type, Union, Optional, Coroutine
+from typing import Any, Callable, Type, Union, Optional
+from collections.abc import Coroutine
 from types import TracebackType
 
 if typing.TYPE_CHECKING:
index 58595e6bc5130fe24c4ed4a0117ec8b6acc4dc84..d6e12b895e27b9b07a6a9201dcc70e0ff8285dbb 100644 (file)
@@ -22,11 +22,10 @@ import zlib
 
 from typing import (
     Any,
-    Mapping,
-    Match,
     Callable,
-    Sequence,
 )
+from collections.abc import Mapping, Sequence
+from re import Match
 
 if typing.TYPE_CHECKING:
     # Additional imports only used in type comments.
index 2166b50e10b544e17a55a8aef829b638bd8672ef..aa48c1f3153d1bc01374c3c7703e9ac9da694843 100644 (file)
@@ -110,15 +110,13 @@ from typing import (
     Any,
     Union,
     Optional,
-    Awaitable,
     Callable,
-    Iterable,
-    Generator,
     Type,
     TypeVar,
     cast,
     overload,
 )
+from collections.abc import Awaitable, Iterable, Generator
 from types import TracebackType
 import typing
 
index b732b73b5dc16c362929ab5e4cf1929d82d62d6b..b7eed5108cbf18ec76a3329c422712eecc94eca3 100644 (file)
@@ -43,10 +43,10 @@ from typing import (
     Any,
     Optional,
     Union,
-    Awaitable,
     Callable,
     Type,
 )
+from collections.abc import Awaitable
 from types import TracebackType
 
 if TYPE_CHECKING: