#2 Python 3.11 compatibility
Merged 2 years ago by churchyard. Opened 2 years ago by thrnciar.
rpms/ thrnciar/python-aiohttp-cors python3.11-compatibility  into  rawhide

@@ -0,0 +1,27 @@ 

+ From 1eb2226aaf664d0be746753a32f82ee2e04c2f0b Mon Sep 17 00:00:00 2001

+ From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= <thrnciar@redhat.com>

+ Date: Tue, 1 Mar 2022 15:31:54 +0100

+ Subject: [PATCH] Replace @asyncio.coroutine decorator with async def

+ 

+ In Python 3.11 @asyncio.coroutine decorator was removed and it should

+ be replaced with async def call.

+ 

+ Fixes: #280

+ ---

+  tests/unit/test_cors_config.py | 3 +--

+  1 file changed, 1 insertion(+), 2 deletions(-)

+ 

+ diff --git a/tests/unit/test_cors_config.py b/tests/unit/test_cors_config.py

+ index 817410e..9fe1052 100644

+ --- a/tests/unit/test_cors_config.py

+ +++ b/tests/unit/test_cors_config.py

+ @@ -29,8 +29,7 @@ async def _handler(request):

+  

+  class _View(web.View, CorsViewMixin):

+  

+ -    @asyncio.coroutine

+ -    def get(self):

+ +    async def get(self):

+          return web.Response(text="Done")

+  

+  

@@ -17,6 +17,10 @@ 

  # Fix test failure of test_static_resource

  Patch2:         %{url}/pull/278/commits/e64b95848f3253157d831f4934841fceeaf9b2e3.patch

  

+ # Python 3.11 compatibility

+ # Replace @asyncio.coroutine decorator with async def

+ Patch3:         %{url}/pull/412/commits/1eb2226aaf664d0be746753a32f82ee2e04c2f0b.patch

+ 

  BuildArch:      noarch

  

  %description