www/py-aioh2: Fix build with Python 3.7+

This commit is contained in:
Po-Chuan Hsieh 2022-03-25 21:04:49 +08:00
parent ac13892e7e
commit 213add47de
No known key found for this signature in database
GPG key ID: 9A4BD10F002DD04B
3 changed files with 20 additions and 1 deletions

View file

@ -12,7 +12,7 @@ COMMENT= HTTP/2 implementation with hyper-h2 on Python 3 asyncio
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}h2>=3:www/py-h2@${PY_FLAVOR} \
xRUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}h2>=3:www/py-h2@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}priority>=1.3.0:www/py-priority@${PY_FLAVOR}
USES= python:3.4+

View file

@ -0,0 +1,8 @@
--- aioh2/helper.py.orig 2018-02-05 02:31:19 UTC
+++ aioh2/helper.py
@@ -86,4 +86,4 @@ if hasattr(socket, 'AF_UNIX'):
if hasattr(asyncio, 'ensure_future'): # Python >= 3.5
async_task = asyncio.ensure_future
else:
- async_task = asyncio.async
+ async_task = getattr(asyncio, "async")

View file

@ -0,0 +1,11 @@
--- aioh2/protocol.py.orig 2017-12-03 09:08:55 UTC
+++ aioh2/protocol.py
@@ -380,7 +380,7 @@ class H2Protocol(asyncio.Protocol):
if self._handler:
raise Exception('Handler was already set')
if handler:
- self._handler = asyncio.async(handler, loop=self._loop)
+ self._handler = async_task(handler, loop=self._loop)
def close_connection(self):
self._transport.close()