a
´iM ã @ sB d Z ddlmZ ddlmZ ddlmZ ddœdd„Zd d
„ ZdS ))Úruné )Ú
coroutines)Úevents)ÚtasksN)Údebugc C sV t ¡ d urtdƒ‚t | ¡s,td | ¡ƒ‚t ¡ }zÊt |¡ |d urR| |¡ |
| ¡W z:t|ƒ |
| ¡ ¡ |
|
¡ ¡ W t d ¡ | ¡ S t d ¡ | ¡ 0 S z:t|ƒ |
| ¡ ¡ |
|
¡ ¡ W t d ¡ | ¡ nt d ¡ | ¡ 0 nRz:t|ƒ |
| ¡ ¡ |
|
¡ ¡ W t d ¡ | ¡ nt d ¡ | ¡ 0 0 d S )Nz8asyncio.run() cannot be called from a running event loopz"a coroutine was expected, got {!r})r Z_get_running_loopÚRuntimeErrorr ZiscoroutineÚ
ValueErrorÚformatZnew_event_loopZset_event_loopZ set_debugÚrun_until_completeÚ_cancel_all_tasksZshutdown_asyncgensZshutdown_default_executorÚclose)Úmainr Úloop© r ú'/usr/lib64/python3.9/asyncio/runners.pyr sJ ÿ
ÿ
ø
ÿ
ú
ÿ
r c C sv t | ¡}|sd S |D ]}| ¡ q| t j|| ddœŽ¡ |D ]0}| ¡ rNq@| ¡ d ur@| d| ¡ |dœ¡ q@d S )NT)r Zreturn_exceptionsz1unhandled exception during asyncio.run() shutdown)ÚmessageÚ exceptionÚtask)r Z all_tasksÚcancelr
Z_gatherÚ cancelledr Zcall_exception_handler)r Z to_cancelr r r r r 7 s"
ÿýr )Ú__all__Ú r r r r r r r r r Ú