Your IP : 3.141.45.90


Current Path : /opt/alt/python310/lib64/python3.10/asyncio/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/asyncio/__pycache__/coroutines.cpython-310.opt-1.pyc

o

6��f]"�@s�dZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddl
mZddl
m
Z
ddlmZdd	�Ze�ZGd
d�d�Zdd
�Ze�Zdd�ZejejejjefZe�Zdd�Zdd�ZdS))�	coroutine�iscoroutinefunction�iscoroutine�N�)�base_futures)�	constants)�format_helpers)�loggercCs"tjjptjjottj�d��S)NZPYTHONASYNCIODEBUG)�sys�flags�dev_mode�ignore_environment�bool�os�environ�get�rr�9/opt/alt/python310/lib64/python3.10/asyncio/coroutines.py�_is_debug_modes�rc@s�eZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zddd
�Zdd�Z	e
dd��Ze
dd��Ze
dd��Z
dd�Ze
dd��Zdd�ZdS)�CoroWrapperNcCs>||_||_t�t�d��|_t|dd�|_t|dd�|_	dS)Nr�__name__�__qualname__)
�gen�funcr�
extract_stackr
�	_getframe�_source_traceback�getattrrr)�selfrrrrr�__init__'s
zCoroWrapper.__init__cCsJt|�}|jr|jd}|d|d�d|d��7}d|jj�d|�d�S)	N���z
, created at r�:r�<� �>)�_format_coroutiner�	__class__r)r�	coro_repr�framerrr�__repr__/s

zCoroWrapper.__repr__cC�|S�Nr�rrrr�__iter__7�zCoroWrapper.__iter__cCs|j�d�Sr+�r�sendr,rrr�__next__:�zCoroWrapper.__next__cCs|j�|�Sr+r/)r�valuerrrr0=r2zCoroWrapper.sendcCs|j�|||�Sr+)r�throw)r�typer3�	tracebackrrrr4@szCoroWrapper.throwcCs
|j��Sr+)r�closer,rrrr7Cs
zCoroWrapper.closecC�|jjSr+)r�gi_framer,rrrr9F�zCoroWrapper.gi_framecCr8r+)r�
gi_runningr,rrrr;Jr:zCoroWrapper.gi_runningcCr8r+)r�gi_coder,rrrr<Nr:zCoroWrapper.gi_codecCr*r+rr,rrr�	__await__Rr.zCoroWrapper.__await__cCr8r+)r�gi_yieldfromr,rrrr>Ur:zCoroWrapper.gi_yieldfromcCs�t|dd�}t|dd�}|dur@|jdkrB|�d�}t|dd�}|r9d�t�|��}|dtj�d	�7}||��7}t�	|�dSdSdS)
Nrr9r z was never yielded fromrr�zB
Coroutine object created at (most recent call last, truncated to z last lines):
)
r�f_lasti�joinr6�format_listrZDEBUG_STACK_DEPTH�rstripr	�error)rrr(�msg�tbrrr�__del__Ys

��zCoroWrapper.__del__r+)NN)r�
__module__rrr)r-r1r0r4r7�propertyr9r;r<r=r>rGrrrrr$s$





rcsztjdtdd�t���r�St���r��nt����fdd���t�	���t
s,�}nt�����fdd��}t|_|S)z�Decorator to mark coroutines.

    If the coroutine is not yielded from before it is destroyed,
    an error message is logged.
    zN"@coroutine" decorator is deprecated since Python 3.8, use "async def" instead�)�
stacklevelc?sz��|i|��}t�|�st�|�st|t�r|EdH}|Sz|j}Wn
ty-Y|Swt|tj	j
�r;|�EdH}|Sr+)rZisfuture�inspectZisgenerator�
isinstancerr=�AttributeError�collections�abc�	Awaitable)�args�kw�resZ
await_meth�rrr�corozs ��

�
�zcoroutine.<locals>.corocsDt�|i|���d�}|jr|jd=t�dd�|_t�dd�|_|S)NrUr rr)rrrrr)rR�kwds�w�rVrrr�wrapper�szcoroutine.<locals>.wrapper)�warnings�warn�DeprecationWarningrLr�isgeneratorfunction�	functools�wraps�typesr�_DEBUG�
_is_coroutine)rrZrrYrris"�


rcCst�|�pt|dd�tuS)z6Return True if func is a decorated coroutine function.rcN)rLrrrcrUrrrr�s
�rcCs<t|�tvrdSt|t�rtt�dkrt�t|��dSdS)z)Return True if obj is a coroutine object.T�dF)r5�_iscoroutine_typecacherM�_COROUTINE_TYPES�len�add)�objrrrr�s
rc
sdt|t���fdd�}dd�}d}t|d�r|jr|j}nt|d�r(|jr(|j}||�}|s9||�r7|�d�S|Sd}t|d�rG|jrG|j}nt|d	�rR|jrR|j}|jpVd
}d}�r�|jdur�t	�
|j�s�t�|j�}|durt|\}}|dur�|�d|�d
|��}	|	S|�d|�d
|��}	|	S|dur�|j
}|�d|�d
|��}	|	S|j}|�d|�d
|��}	|	S)Ncs`�r
t�|jdi�St|d�r|jr|j}nt|d�r"|jr"|j}n	dt|�j�d�}|�d�S)Nrrrr"z without __name__>z())rZ_format_callbackr�hasattrrrr5)rV�	coro_name�Zis_corowrapperrr�get_name�s
z#_format_coroutine.<locals>.get_namecSs<z|jWStyz|jWYStyYYdSww)NF)�
cr_runningrNr;)rVrrr�
is_running�s��z%_format_coroutine.<locals>.is_running�cr_coder<z runningr9�cr_framez<empty co_filename>rz done, defined at r!z running, defined at z running at )rMrrjrpr<r9rq�co_filenamerrLr^rZ_get_function_source�f_lineno�co_firstlineno)
rVrmroZ	coro_coderkZ
coro_frame�filename�lineno�sourcer'rrlrr%�sN
	



��
��r%) �__all__Zcollections.abcrOr_rLrr
r6rar[r?rrr�logr	rrbrr�objectrcr�
CoroutineType�
GeneratorTyperP�	Coroutinerf�setrerr%rrrr�<module>s2E8�

?>