Skip to content

Commit

Permalink
dev-python/aiohttp: enable py3.10
Browse files Browse the repository at this point in the history
patch taken from comment here:
aio-libs/aiohttp#5905

Signed-off-by: Arthur Zamarin <[email protected]>
Signed-off-by: Michał Górny <[email protected]>
  • Loading branch information
arthurzam committed Jul 29, 2021
1 parent 370b33b commit dd48104
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dev-python/aiohttp/aiohttp-3.7.4-r1.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

EAPI=7

PYTHON_COMPAT=( python3_{8..9} )
PYTHON_COMPAT=( python3_{8..10} )

inherit distutils-r1 multiprocessing

Expand Down Expand Up @@ -42,6 +42,7 @@ BDEPEND="

PATCHES=(
"${FILESDIR}"/aiohttp-3.7.4-brotli.patch
"${FILESDIR}"/aiohttp-3.7.4-fix-py3.10.patch
)

DOCS=( CHANGES.rst CONTRIBUTORS.txt README.rst )
Expand Down
73 changes: 73 additions & 0 deletions dev-python/aiohttp/files/aiohttp-3.7.4-fix-py3.10.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
commit ec87d9f2b6541599dd7fc8aaebf0fdfbb812ade7
Author: Louis Sautier <[email protected]>
Date: Tue Jul 20 23:37:27 2021 +0200

Remove deprecated loop argument from asyncio.sleep/gather calls

diff --git a/aiohttp/web.py b/aiohttp/web.py
index 557e3c3b..52dfdf93 100644
--- a/aiohttp/web.py
+++ b/aiohttp/web.py
@@ -441,7 +441,7 @@ def _cancel_tasks(
task.cancel()

loop.run_until_complete(
- asyncio.gather(*to_cancel, loop=loop, return_exceptions=True)
+ asyncio.gather(*to_cancel, return_exceptions=True)
)

for task in to_cancel:
diff --git a/tests/test_locks.py b/tests/test_locks.py
index 55fd2330..5f434eac 100644
--- a/tests/test_locks.py
+++ b/tests/test_locks.py
@@ -18,7 +18,7 @@ class TestEventResultOrError:
return 1

t = loop.create_task(c())
- await asyncio.sleep(0, loop=loop)
+ await asyncio.sleep(0)
e = Exception()
ev.set(exc=e)
assert (await t) == e
@@ -31,7 +31,7 @@ class TestEventResultOrError:
return 1

t = loop.create_task(c())
- await asyncio.sleep(0, loop=loop)
+ await asyncio.sleep(0)
ev.set()
assert (await t) == 1

@@ -43,7 +43,7 @@ class TestEventResultOrError:

t1 = loop.create_task(c())
t2 = loop.create_task(c())
- await asyncio.sleep(0, loop=loop)
+ await asyncio.sleep(0)
ev.cancel()
ev.set()

diff --git a/tests/test_proxy_functional.py b/tests/test_proxy_functional.py
index 68763cd4..65c773a1 100644
--- a/tests/test_proxy_functional.py
+++ b/tests/test_proxy_functional.py
@@ -238,7 +238,7 @@ async def test_proxy_http_multi_conn_limit(proxy_test_server, loop) -> None:
resp = await sess.get(url, proxy=proxy.url)

current_pid = pid
- await asyncio.sleep(0.2, loop=loop)
+ await asyncio.sleep(0.2)
assert current_pid == pid

await resp.release()
@@ -443,7 +443,7 @@ async def xtest_proxy_https_multi_conn_limit(proxy_test_server, loop):
resp = await sess.get(url, proxy=proxy.url)

current_pid = pid
- await asyncio.sleep(0.2, loop=loop)
+ await asyncio.sleep(0.2)
assert current_pid == pid

await resp.release()

0 comments on commit dd48104

Please sign in to comment.