1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-20 00:21:35 +00:00

www/py-ws4py: Fix build with setuptools 58.0.0+

With hat:	python
This commit is contained in:
Po-Chuan Hsieh 2022-04-16 12:15:45 +08:00
parent 7e7e27793c
commit 291e8f2aec
No known key found for this signature in database
GPG Key ID: 9A4BD10F002DD04B

View File

@ -0,0 +1,31 @@
--- ws4py/async_websocket.py.orig 2014-01-25 21:30:21 UTC
+++ ws4py/async_websocket.py
@@ -84,7 +84,7 @@ class WebSocket(_WebSocket):
def closeit():
yield from self.proto.writer.drain()
self.proto.writer.close()
- asyncio.async(closeit())
+ asyncio.ensure_future(closeit())
def _write(self, data):
"""
@@ -94,7 +94,7 @@ class WebSocket(_WebSocket):
def sendit(data):
self.proto.writer.write(data)
yield from self.proto.writer.drain()
- asyncio.async(sendit(data))
+ asyncio.ensure_future(sendit(data))
@asyncio.coroutine
def run(self):
--- ws4py/server/tulipserver.py.orig 2014-01-25 21:30:21 UTC
+++ ws4py/server/tulipserver.py
@@ -40,7 +40,7 @@ class WebSocketProtocol(asyncio.StreamReaderProtocol):
#self.stream.set_transport(transport)
asyncio.StreamReaderProtocol.connection_made(self, transport)
# Let make it concurrent for others to tag along
- f = asyncio.async(self.handle_initial_handshake())
+ f = asyncio.ensure_future(self.handle_initial_handshake())
f.add_done_callback(self.terminated)
@property