Skip to content

Commit a9bf85e

Browse files
authored
Merge pull request #3572 from takluyver/compat-cleanup
Clean up some compatibility for older Python versions
2 parents 2baba22 + f16b5de commit a9bf85e

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

tornado/concurrent.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,8 @@ def submit( # type: ignore[override]
6464
future_set_exc_info(future, sys.exc_info())
6565
return future
6666

67-
if sys.version_info >= (3, 9):
68-
69-
def shutdown(self, wait: bool = True, cancel_futures: bool = False) -> None:
70-
pass
71-
72-
else:
73-
74-
def shutdown(self, wait: bool = True) -> None:
75-
pass
67+
def shutdown(self, wait: bool = True, cancel_futures: bool = False) -> None:
68+
pass
7669

7770

7871
dummy_executor = DummyExecutor()

tornado/httputil.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@
6161
from asyncio import Future # noqa: F401
6262
import unittest # noqa: F401
6363

64-
# This can be done unconditionally in the base class of HTTPHeaders
65-
# after we drop support for Python 3.8.
66-
StrMutableMapping = collections.abc.MutableMapping[str, str]
67-
else:
68-
StrMutableMapping = collections.abc.MutableMapping
69-
7064
# To be used with str.strip() and related methods.
7165
HTTP_WHITESPACE = " \t"
7266

@@ -141,7 +135,7 @@ def _normalize_header(name: str) -> str:
141135
return "-".join([w.capitalize() for w in name.split("-")])
142136

143137

144-
class HTTPHeaders(StrMutableMapping):
138+
class HTTPHeaders(collections.abc.MutableMapping[str, str]):
145139
"""A dictionary that maintains ``Http-Header-Case`` for all keys.
146140
147141
Supports multiple values per key via a pair of new methods,

0 commit comments

Comments
 (0)