Skip to content

Commit

Permalink
www/py-aioh2: Fix build with Python 3.7+
Browse files Browse the repository at this point in the history
  • Loading branch information
sunpoet committed Mar 25, 2022
1 parent ac13892 commit 213add4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion www/py-aioh2/Makefile
Expand Up @@ -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+
Expand Down
8 changes: 8 additions & 0 deletions www/py-aioh2/files/patch-aioh2-helper.py
@@ -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")
11 changes: 11 additions & 0 deletions www/py-aioh2/files/patch-aioh2-protocol.py
@@ -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()

0 comments on commit 213add4

Please sign in to comment.