mirror of
https://github.com/YunoHost/yunorunner.git
synced 2024-09-03 20:05:52 +02:00
Fix DeprecationWarning: "@coroutine"
python[11090]: /var/www/yunorunner/./run.py:119: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead python[11090]: def wait_closed(self):
This commit is contained in:
parent
5572f746ef
commit
6508dcf51d
1 changed files with 2 additions and 3 deletions
5
run.py
5
run.py
|
@ -115,8 +115,7 @@ def datetime_to_epoch_json_converter(o):
|
|||
return o.strftime('%s')
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
def wait_closed(self):
|
||||
async def wait_closed(self):
|
||||
"""
|
||||
Wait until the connection is closed.
|
||||
|
||||
|
@ -126,7 +125,7 @@ def wait_closed(self):
|
|||
of its cause, in tasks that interact with the WebSocket connection.
|
||||
|
||||
"""
|
||||
yield from asyncio.shield(self.connection_lost_waiter)
|
||||
await asyncio.shield(self.connection_lost_waiter)
|
||||
|
||||
|
||||
# this is a backport of websockets 7.0 which sanic doesn't support yet
|
||||
|
|
Loading…
Add table
Reference in a new issue