Skip to content

Commit

Permalink
Remove workarounds for versions earlier than Python 3.10
Browse files Browse the repository at this point in the history
See-Also: #275
  • Loading branch information
chrysn committed Jul 21, 2024
1 parent 6707716 commit 219575d
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 30 deletions.
14 changes: 0 additions & 14 deletions aiocoap/pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import asyncio
from collections import namedtuple
import functools
import sys

from . import error
from .numbers import INTERNAL_SERVER_ERROR
Expand Down Expand Up @@ -221,19 +220,6 @@ async def wrapped():
wrapped(),
name=name,
)
if sys.version_info < (3, 8):
# These Python versions used to complain about cancelled tasks, where
# really a cancelled task is perfectly natural (especially here where
# it's just not needed any more because nobody is listening to what it
# produces). As catching CancellationError doesn't help silencing them,
# this workaround ensures the cancellations don't raise.
def silence_cancellation(task):
try:
task.result()
except asyncio.CancelledError:
pass

task.add_done_callback(silence_cancellation)
pipe.on_interest_end(task.cancel)


Expand Down
7 changes: 0 additions & 7 deletions tests/test_doctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@ def _load_tests():
and not aiocoap.defaults.is_pyodide
):
continue
if "udp6" in p and (
# due to https://foss.heptapod.net/pypy/pypy/issues/3249
"PyPy" in sys.version
# if_indextoname etc introduced only in 3.8
or (sys.platform == "win32" and sys.version_info < (3, 8))
):
continue
for t in doctest.DocTestSuite(p):
i += 1

Expand Down
9 changes: 0 additions & 9 deletions tests/test_tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,6 @@ async def test_tls(self):
"SNI name was not used by the server",
)

if sys.version_info < (3, 7):
test_tls = unittest.expectedFailure(
test_tls
) # SNI support was only added in Python 3.7
if "PyPy" in sys.version:
# For PyPy exclusion, see https://foss.heptapod.net/pypy/pypy/-/issues/3359
# Completely skipping a test that causes segfaults
test_tls = None


if __name__ == "__main__":
# due to the imports, you'll need to run this as `python3 -m tests.test_server`
Expand Down

0 comments on commit 219575d

Please sign in to comment.