]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Clean up some compatibility for older Python versions 3572/head
authorThomas Kluyver <thomas@kluyver.me.uk>
Sat, 17 Jan 2026 18:44:06 +0000 (18:44 +0000)
committerThomas Kluyver <thomas@kluyver.me.uk>
Sat, 17 Jan 2026 18:44:06 +0000 (18:44 +0000)
tornado/concurrent.py
tornado/httputil.py

index e98093f2158ceef58f1760e8ddfdbd3e7e179429..41958ab6faf90cb72d0c9ace91de3556f76d9016 100644 (file)
@@ -64,15 +64,8 @@ class DummyExecutor(futures.Executor):
             future_set_exc_info(future, sys.exc_info())
         return future
 
-    if sys.version_info >= (3, 9):
-
-        def shutdown(self, wait: bool = True, cancel_futures: bool = False) -> None:
-            pass
-
-    else:
-
-        def shutdown(self, wait: bool = True) -> None:
-            pass
+    def shutdown(self, wait: bool = True, cancel_futures: bool = False) -> None:
+        pass
 
 
 dummy_executor = DummyExecutor()
index 74dfb87f171862b63e54b391cd8851349c1c9b52..44f86ea39eeacb123b204aa5a4eb41238cd8df74 100644 (file)
@@ -61,12 +61,6 @@ if typing.TYPE_CHECKING:
     from asyncio import Future  # noqa: F401
     import unittest  # noqa: F401
 
-    # This can be done unconditionally in the base class of HTTPHeaders
-    # after we drop support for Python 3.8.
-    StrMutableMapping = collections.abc.MutableMapping[str, str]
-else:
-    StrMutableMapping = collections.abc.MutableMapping
-
 # To be used with str.strip() and related methods.
 HTTP_WHITESPACE = " \t"
 
@@ -141,7 +135,7 @@ def _normalize_header(name: str) -> str:
     return "-".join([w.capitalize() for w in name.split("-")])
 
 
-class HTTPHeaders(StrMutableMapping):
+class HTTPHeaders(collections.abc.MutableMapping[str, str]):
     """A dictionary that maintains ``Http-Header-Case`` for all keys.
 
     Supports multiple values per key via a pair of new methods,