Update cherrypy==18.9.0

This commit is contained in:
JonnyWong16 2024-03-24 17:55:12 -07:00
parent 2fc618c01f
commit 51196a7fb1
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
137 changed files with 44442 additions and 11582 deletions

View file

@ -20,7 +20,7 @@ from functools import wraps
from inspect import signature
def _launch_forever_coro(coro, args, kwargs, loop):
async def _run_forever_coro(coro, args, kwargs, loop):
'''
This helper function launches an async main function that was tagged with
forever=True. There are two possibilities:
@ -48,7 +48,7 @@ def _launch_forever_coro(coro, args, kwargs, loop):
# forever=True feature from autoasync at some point in the future.
thing = coro(*args, **kwargs)
if iscoroutine(thing):
loop.create_task(thing)
await thing
def autoasync(coro=None, *, loop=None, forever=False, pass_loop=False):
@ -127,7 +127,9 @@ def autoasync(coro=None, *, loop=None, forever=False, pass_loop=False):
args, kwargs = bound_args.args, bound_args.kwargs
if forever:
_launch_forever_coro(coro, args, kwargs, local_loop)
local_loop.create_task(_run_forever_coro(
coro, args, kwargs, local_loop
))
local_loop.run_forever()
else:
return local_loop.run_until_complete(coro(*args, **kwargs))