/usr/lib/python3.10/asyncio/__pycache__
Edit: /usr/lib/python3.10/asyncio/__pycache__/runners.cpython-310.pyc (2092B)
o
…9j8 ã @ sB d Z ddlmZ ddlmZ ddlmZ ddœdd„Zd d
„ ZdS ))Úruné )Ú
coroutines)Úevents)ÚtasksN)Údebugc C sü t ¡ dur
tdƒ‚t | ¡std | ¡ƒ‚t ¡ }z;t |¡ |dur)| |¡ |
| ¡W zt|ƒ |
| ¡ ¡ |
|
¡ ¡ W t d¡ | ¡ S t d¡ | ¡ w zt|ƒ |
| ¡ ¡ |
|
¡ ¡ W t d¡ | ¡ w t d¡ | ¡ w )a¥ Execute the coroutine and return the result.
This function runs the passed coroutine, taking care of
managing the asyncio event loop and finalizing asynchronous
generators.
This function cannot be called when another asyncio event loop is
running in the same thread.
If debug is True, the event loop will be run in debug mode.
This function always creates a new event loop and closes it at the end.
It should be used as a main entry point for asyncio programs, and should
ideally only be called once.
Example:
async def main():
await asyncio.sleep(1)
print('hello')
asyncio.run(main())
Nz8asyncio.run() cannot be called from a running event loopz"a coroutine was expected, got {!r})r Ú_get_running_loopÚRuntimeErrorr ÚiscoroutineÚ
ValueErrorÚformatÚnew_event_loopÚset_event_loopÚ set_debugÚrun_until_completeÚ_cancel_all_tasksÚshutdown_asyncgensÚshutdown_default_executorÚclose)Úmainr Úloop© r ú&/usr/lib/python3.10/asyncio/runners.pyr s8 ÿ
ÿ
ú
ÿ
r c C st t | ¡}|s d S |D ]}| ¡ q| t j|ddiŽ¡ |D ]}| ¡ r&q| ¡ d ur7| d| ¡ |dœ¡ qd S )NÚreturn_exceptionsTz1unhandled exception during asyncio.run() shutdown)ÚmessageÚ exceptionÚtask)r Ú all_tasksÚcancelr ÚgatherÚ cancelledr Úcall_exception_handler)r Ú to_cancelr r r r r 7 s"
ý€ür )Ú__all__Ú r r r r r r r r r Ú
s /