관리-도구
편집 파일: coroutines.cpython-39.pyc
a �����DOg]"����������������������@���s����d�Z�ddlZddlZddlZddlZddlZddlZddlZddl Z ddl mZ�ddl mZ�ddl m Z �ddlmZ�dd ��Ze��ZG�d d��d�Zdd ��Ze��Zdd��ZejejejjefZe��Zdd��Zdd��ZdS�))� coroutine�iscoroutinefunction�iscoroutine�����N����)�base_futures)� constants)�format_helpers)�loggerc�������������������C���s"���t�jjp t�jj�o ttj�d��S�)NZPYTHONASYNCIODEBUG)�sys�flags�dev_mode�ignore_environment�bool�os�environ�get��r���r����*/usr/lib64/python3.9/asyncio/coroutines.py�_is_debug_mode���s�����r���c�������������������@���s����e�Zd�Zddd�Zdd��Zdd��Zdd ��Zd d��Zddd �Zdd��Z e dd���Ze dd���Ze dd���Z dd��Ze dd���Zdd��ZdS�)�CoroWrapperNc�����������������C���sZ���t��|�st��|�sJ�|��||�_||�_t�t�d��|�_ t |dd��|�_t |dd��|�_d�S�)Nr����__name__�__qualname__) �inspect�isgeneratorr����gen�funcr���� extract_stackr ���� _getframe�_source_traceback�getattrr���r���)�selfr���r���r���r���r����__init__'���s����zCoroWrapper.__init__c�����������������C���sJ���t�|��}|�jr4|�jd�}|d|d���d|d����7�}d|�jj��d|��d�S�) N���z , created at r����:r����<� �>)�_format_coroutiner���� __class__r���)r ���� coro_repr�framer���r���r����__repr__/���s ���� zCoroWrapper.__repr__c�����������������C���s���|�S��Nr����r ���r���r���r����__iter__7���s����zCoroWrapper.__iter__c�����������������C���s���|�j��d��S�r,����r����sendr-���r���r���r����__next__:���s����zCoroWrapper.__next__c�����������������C���s���|�j��|�S�r,���r/���)r ����valuer���r���r���r0���=���s����zCoroWrapper.sendc�����������������C���s���|�j��|||�S�r,���)r����throw)r ����typer2���� tracebackr���r���r���r3���@���s����zCoroWrapper.throwc�����������������C���s ���|�j����S�r,���)r����closer-���r���r���r���r6���C���s����zCoroWrapper.closec�����������������C���s���|�j�jS�r,���)r����gi_framer-���r���r���r���r7���F���s����zCoroWrapper.gi_framec�����������������C���s���|�j�jS�r,���)r���� gi_runningr-���r���r���r���r8���J���s����zCoroWrapper.gi_runningc�����������������C���s���|�j�jS�r,���)r����gi_coder-���r���r���r���r9���N���s����zCoroWrapper.gi_codec�����������������C���s���|�S�r,���r���r-���r���r���r���� __await__R���s����zCoroWrapper.__await__c�����������������C���s���|�j�jS�r,���)r����gi_yieldfromr-���r���r���r���r;���U���s����zCoroWrapper.gi_yieldfromc�����������������C���s����t�|�dd��}t�|dd��}|d�ur||jdkr||��d�}t�|�dd�}|rrd�t�|��}|dtj��d �7�}||���7�}t� |��d�S�) Nr���r7���r"���z was never yielded fromr���r�����zB Coroutine object created at (most recent call last, truncated to z last lines): ) r����f_lasti�joinr5����format_listr���ZDEBUG_STACK_DEPTH�rstripr ����error)r ���r���r*����msg�tbr���r���r����__del__Y���s���� � zCoroWrapper.__del__)N)NN)r���� __module__r���r!���r+���r.���r1���r0���r3���r6����propertyr7���r8���r9���r:���r;���rD���r���r���r���r���r���$���s"��� r���c��������������������sz���t�jdtdd��t���r�S�t���r.���nt����fdd����t� �����t sX��}nt������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������������������?���st�����|�i�|��}t��|�s,t�|�s,t|t�r8|E�d�H�}n8z |j}W�n�tyT���Y�n0�t|tj j �rp|��E�d�H�}|S�r,���)r���Zisfuturer���r���� isinstancer���r:����AttributeError�collections�abc� Awaitable)�args�kw�resZ await_meth�r���r���r����coroz���s����� zcoroutine.<locals>.coroc���������������������sD���t���|�i�|���d�}|jr$|jd=�t�dd��|_t�dd��|_|S�)NrQ���r"���r���r���)r���r���r���r���r���)rN����kwds�w�rR���r���r���r����wrapper����s����zcoroutine.<locals>.wrapper)�warnings�warn�DeprecationWarningr���r����isgeneratorfunction� functools�wraps�typesr����_DEBUG� _is_coroutine)r���rV���r���rU���r���r���i���s"����� r���c�����������������C���s���t��|��pt|�dd�tu�S�)z6Return True if func is a decorated coroutine function.r_���N)r���r���r���r_���rQ���r���r���r���r�������s���� �r���c�����������������C���s@���t�|��tv�rdS�t|�t�r8tt�dk�r4t�t�|����dS�dS�dS�)z)Return True if obj is a coroutine object.T�d���FN)r4����_iscoroutine_typecacherI����_COROUTINE_TYPES�len�add)�objr���r���r���r�������s���� r���c����������� ���������st��t�|��sJ��t|�t�����fdd�}dd��}d�}t|�d�rF|�jrF|�j}nt|�d�r\|�jr\|�j}||��}|s~||��rz|��d�S�|S�d�}t|�d�r�|�jr�|�j}nt|�d �r�|�jr�|�j}|jp�d }d}���r0|�j d�u�r0t �|�j ��s0t� |�j �}|d�ur�|\}}|d�u��r|��d|��d |���} n|��d|��d |���} n@|d�u�rV|j}|��d|��d |���} n|j}|��d|��d |���} | S�)Nc��������������������s`�����rt��|�jdi��S�t|�d�r,|�jr,|�j}n*t|�d�rD|�jrD|�j}ndt|��j��d�}|��d�S�)Nr���r���r���r$���z without __name__>z())r���Z_format_callbackr����hasattrr���r���r4���)rR���� coro_name�Zis_corowrapperr���r����get_name����s����z#_format_coroutine.<locals>.get_namec�����������������S���sD���z|�j�W�S��ty>���z|�jW��Y�S��ty8���Y�Y�dS�0�Y�n0�d�S�)NF)� cr_runningrJ���r8���)rR���r���r���r���� is_running����s����z%_format_coroutine.<locals>.is_running�cr_coder9���z runningr7����cr_framez<empty co_filename>r���z done, defined at r#���z running, defined at z running at )r���rI���r���rf���rl���r9���r7���rm����co_filenamer���r���rZ���r���Z_get_function_source�f_lineno�co_firstlineno) rR���ri���rk���Z coro_coderg���Z coro_frame�filename�lineno�sourcer)���r���rh���r���r'�������sL���� � � r'���) �__all__�collections.abcrK���r[���r���r���r ���r5���r]���rW���r<���r���r���r����logr ���r���r^���r���r����objectr_���r���� CoroutineType� GeneratorTyperL���� Coroutinerb����setra���r���r'���r���r���r���r����<module>���s0���E8�