diff --git a/py3109-compat.patch b/py3109-compat.patch index 6296bba..46633f6 100644 --- a/py3109-compat.patch +++ b/py3109-compat.patch @@ -2,7 +2,15 @@ Index: aiohttp-3.8.3/tests/test_client_request.py =================================================================== --- aiohttp-3.8.3.orig/tests/test_client_request.py +++ aiohttp-3.8.3/tests/test_client_request.py -@@ -19,7 +19,6 @@ from aiohttp.client_reqrep import ( +@@ -2,6 +2,7 @@ import asyncio + import hashlib + import io + import os.path ++import sys + import urllib.parse + import zlib + from http.cookies import BaseCookie, Morsel, SimpleCookie +@@ -19,7 +20,6 @@ from aiohttp.client_reqrep import ( Fingerprint, _merge_ssl_params, ) @@ -10,24 +18,28 @@ Index: aiohttp-3.8.3/tests/test_client_request.py from aiohttp.test_utils import make_mocked_coro -@@ -275,12 +274,6 @@ def test_host_header_ipv6_with_port(make - assert req.headers["HOST"] == "[::2]:99" +@@ -276,7 +276,7 @@ def test_host_header_ipv6_with_port(make --@pytest.mark.xfail( + @pytest.mark.xfail( - PY_310, -- reason="No idea why ClientRequest() is constructed out of loop but " -- "it calls `asyncio.get_event_loop()`", -- raises=DeprecationWarning, --) - def test_default_loop(loop) -> None: - asyncio.set_event_loop(loop) - req = ClientRequest("get", URL("http://python.org/")) ++ sys.version_info >= (3, 10) and sys.version_info < (3, 10, 9), + reason="No idea why ClientRequest() is constructed out of loop but " + "it calls `asyncio.get_event_loop()`", + raises=DeprecationWarning, Index: aiohttp-3.8.3/tests/test_streams.py =================================================================== --- aiohttp-3.8.3.orig/tests/test_streams.py +++ aiohttp-3.8.3/tests/test_streams.py -@@ -12,7 +12,6 @@ import pytest +@@ -4,6 +4,7 @@ import abc + import asyncio + import gc + import types ++import sys + from collections import defaultdict + from itertools import groupby + from unittest import mock +@@ -12,7 +13,6 @@ import pytest from re_assert import Matches from aiohttp import streams @@ -35,24 +47,26 @@ Index: aiohttp-3.8.3/tests/test_streams.py DATA = b"line1\nline2\nline3\n" -@@ -83,12 +82,6 @@ class TestStreamReader: - with pytest.raises(RuntimeError): +@@ -84,7 +84,7 @@ class TestStreamReader: await stream._wait("test") -- @pytest.mark.xfail( + @pytest.mark.xfail( - PY_310, -- reason="No idea why ClientRequest() is constructed out of loop but " -- "it calls `asyncio.get_event_loop()`", -- raises=DeprecationWarning, -- ) - def test_ctor_global_loop(self) -> None: - loop = asyncio.new_event_loop() - asyncio.set_event_loop(loop) ++ sys.version_info >= (3, 10) and sys.version_info < (3, 10, 9), + reason="No idea why ClientRequest() is constructed out of loop but " + "it calls `asyncio.get_event_loop()`", + raises=DeprecationWarning, Index: aiohttp-3.8.3/tests/test_web_app.py =================================================================== --- aiohttp-3.8.3.orig/tests/test_web_app.py +++ aiohttp-3.8.3/tests/test_web_app.py -@@ -6,7 +6,7 @@ import pytest +@@ -1,12 +1,13 @@ + import asyncio + import gc ++import sys + from unittest import mock + + import pytest from aiohttp import log, web from aiohttp.abc import AbstractAccessLogger, AbstractRouter @@ -61,16 +75,16 @@ Index: aiohttp-3.8.3/tests/test_web_app.py from aiohttp.test_utils import make_mocked_coro from aiohttp.typedefs import Handler -@@ -39,12 +39,6 @@ async def test_set_loop() -> None: - assert app.loop is loop +@@ -40,9 +41,9 @@ async def test_set_loop() -> None: --@pytest.mark.xfail( + @pytest.mark.xfail( - PY_310, - reason="No idea why _set_loop() is constructed out of loop " - "but it calls `asyncio.get_event_loop()`", -- raises=DeprecationWarning, --) ++ sys.version_info >= (3, 10) and sys.version_info < (3, 10, 9), ++ reason="No idea why ClientRequest() is constructed out of loop but " ++ "it calls `asyncio.get_event_loop()`", + raises=DeprecationWarning, + ) def test_set_loop_default_loop() -> None: - loop = asyncio.new_event_loop() - asyncio.set_event_loop(loop) diff --git a/python-aiohttp.changes b/python-aiohttp.changes index 48f44d0..95d2922 100644 --- a/python-aiohttp.changes +++ b/python-aiohttp.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Dec 12 16:16:31 UTC 2022 - Daniel Garcia + +- Update py3109-compat.patch to work with python <= 3.10.8 too. + ------------------------------------------------------------------- Mon Dec 12 11:26:26 UTC 2022 - Daniel Garcia