tomaszdrozdz added the comment:
I just wanted to call
def main():
asyncio.run(...)
But I can go with Your aproach.
Thanks for discusion.
Should I set status for this issue for closed with resolution rejected ?
Should I delete branch on my forked git repo ?
Can I delete
tomaszdrozdz added the comment:
OK.
I understand.
So how about maybe:
def run(main, *, debug=False, loop=None):
...
if loop:
loop = events.new_event_loop()
So we could customize loop like:
loop = events.new_event_loop
tomaszdrozdz added the comment:
https://docs.python.org/3/library/asyncio-eventloop.html#error-handling-api
Here we can read:
Application developers should typically use the high-level asyncio functions,
such as asyncio.run(), and should rarely need to reference the loop object or
call
Change by tomaszdrozdz :
--
keywords: +patch
pull_requests: +20444
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/21295
___
Python tracker
<https://bugs.python.org/issu
Change by tomaszdrozdz :
--
title: Allo to provide custom exception handler to asyncio.run() -> Allow to
provide custom exception handler to asyncio.run()
___
Python tracker
<https://bugs.python.org/issu
New submission from tomaszdrozdz :
I wish we had:
asyncio.run(coro, *, debug=False, excepton_handler=None)
so we could provide custome exception handler function for the loop.
--
components: asyncio
messages: 372934
nosy: asvetlov, tomaszdrozdz, yselivanov
priority: normal
severity