15
0
Files
python-aiosmtpd/support-python-313.patch
Steve Kowalik 469accceca - Switch to pyproject macros.
- Add patch support-python-313.patch:
  * With Python 3.13, the listening asyncio Unix socket is removed
    on close

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-aiosmtpd?expand=0&rev=32
2024-11-27 23:08:56 +00:00

27 lines
1.1 KiB
Diff

diff --git a/aiosmtpd/tests/test_server.py b/aiosmtpd/tests/test_server.py
index 443c0833..d2251d4a 100644
--- a/aiosmtpd/tests/test_server.py
+++ b/aiosmtpd/tests/test_server.py
@@ -448,10 +448,17 @@ def test_unixsocket(self, safe_socket_dir, autostop_loop, runner):
# Stop the task
cont.end()
catchup_delay()
- # Now the listener has gone away
- # noinspection PyTypeChecker
- with pytest.raises((socket.timeout, ConnectionError)):
- assert_smtp_socket(cont)
+ if sys.version_info < (3, 13):
+ # Now the listener has gone away
+ # noinspection PyTypeChecker
+ with pytest.raises((socket.timeout, ConnectionError)):
+ assert_smtp_socket(cont)
+ else:
+ # Starting from Python 3.13, listening asyncio Unix socket is
+ # removed on close, see:
+ # https://github.com/python/cpython/issues/111246
+ # https://github.com/python/cpython/pull/111483
+ assert not Path(cont.unix_socket).exists()
@pytest.mark.filterwarnings(
"ignore::pytest.PytestUnraisableExceptionWarning"