- Fix calls with deprecated parameters in Python 3.10
Fix deprecated asyncio.gather() and asyncio.sleep() calls on python3.10: TypeError: gather() got an unexpected keyword argument 'loop' backport of https://github.com/aio-libs/aiohttp/commit/a341986d
This commit is contained in:
parent
2ea56a7e24
commit
5ea8782a67
53
python-aiohttp-3.7.4-asyncio-gather-no-loop.patch
Normal file
53
python-aiohttp-3.7.4-asyncio-gather-no-loop.patch
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
diff --git a/CHANGES/5905.bugfix b/CHANGES/5905.bugfix
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..b667968f
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/CHANGES/5905.bugfix
|
||||||
|
@@ -0,0 +1 @@
|
||||||
|
+remove deprecated loop argument for asnycio.sleep/gather calls
|
||||||
|
diff --git a/aiohttp/web.py b/aiohttp/web.py
|
||||||
|
index 557e3c3b..fd654dbb 100644
|
||||||
|
--- a/aiohttp/web.py
|
||||||
|
+++ b/aiohttp/web.py
|
||||||
|
@@ -440,9 +440,7 @@ def _cancel_tasks(
|
||||||
|
for task in to_cancel:
|
||||||
|
task.cancel()
|
||||||
|
|
||||||
|
- loop.run_until_complete(
|
||||||
|
- asyncio.gather(*to_cancel, loop=loop, return_exceptions=True)
|
||||||
|
- )
|
||||||
|
+ loop.run_until_complete(asyncio.gather(*to_cancel, return_exceptions=True))
|
||||||
|
|
||||||
|
for task in to_cancel:
|
||||||
|
if task.cancelled():
|
||||||
|
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()
|
||||||
|
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
Name: python-%{srcname}
|
Name: python-%{srcname}
|
||||||
Version: 3.7.4
|
Version: 3.7.4
|
||||||
Release: 3%{?dist}
|
Release: 4%{?dist}
|
||||||
Summary: Python HTTP client/server for asyncio
|
Summary: Python HTTP client/server for asyncio
|
||||||
|
|
||||||
License: ASL 2.0
|
License: ASL 2.0
|
||||||
@ -16,6 +16,11 @@ Patch0: unbundle-http-parser.patch
|
|||||||
# https://github.com/aio-libs/aiohttp/commit/b0ed732d0a
|
# https://github.com/aio-libs/aiohttp/commit/b0ed732d0a
|
||||||
Patch1: chardet4.patch
|
Patch1: chardet4.patch
|
||||||
|
|
||||||
|
# Fix deprecated asyncio.gather() and asyncio.sleep() calls on python3.10
|
||||||
|
# TypeError: gather() got an unexpected keyword argument 'loop'
|
||||||
|
# https://github.com/aio-libs/aiohttp/commit/a341986d
|
||||||
|
Patch2: python-aiohttp-3.7.4-asyncio-gather-no-loop.patch
|
||||||
|
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
BuildRequires: http-parser-devel
|
BuildRequires: http-parser-devel
|
||||||
|
|
||||||
@ -62,6 +67,9 @@ with middlewares and pluggable routing.
|
|||||||
%{python3_sitearch}/%{srcname}/
|
%{python3_sitearch}/%{srcname}/
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri May 20 2022 Thomas Krennwallner <teakay@aiven.io> - 3.7.4-4
|
||||||
|
- Fix calls with deprecated parameters in Python 3.10
|
||||||
|
|
||||||
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.4-3
|
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.4-3
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user