Your IP : 3.145.152.168


Current Path : /opt/alt/python35/lib64/python3.5/asyncio/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/asyncio/__pycache__/coroutines.cpython-35.opt-2.pyc



���]�)�@s(dddgZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddlm
Z
ddlmZdd	lm
Z
ejd
Zejjo�eejjd��ZyejZejZWnek
rdZdZYnXy
ejZWnek
r9dd
�ZYnXyddlmZm Z!Wne"k
rrdZZ!YnXdd�Z#e#�Z$[#dd�Z%Gdd�d�Z&dd�Ze'�Z(dd�Zej)e&fZ*edk	r�e*ef7Z*edk	refe*Z*dd�Z+dd�Z,dS)�	coroutine�iscoroutinefunction�iscoroutine�N�)�compat)�events)�futures)�loggerZ
YIELD_FROMZPYTHONASYNCIODEBUGcCsdS)NF�)�funcr
r
�//opt/alt/python35/lib64/python3.5/coroutines.py�<lambda>.sr
)�	Coroutine�	AwaitablecCsaGdd�d�}dd�}d}|�}||�}t|�|j|�|j|fkS)	Nc@s@eZdZdd�Zdd�Zdd�Zdd�Zd	S)
z!has_yield_from_bug.<locals>.MyGencSs
d|_dS)N)�	send_args)�selfr
r
r�__init__:sz*has_yield_from_bug.<locals>.MyGen.__init__cSs|S)Nr
)rr
r
r�__iter__<sz*has_yield_from_bug.<locals>.MyGen.__iter__cSsdS)N�*r
)rr
r
r�__next__>sz*has_yield_from_bug.<locals>.MyGen.__next__cWs
||_dS)N)r)rZwhatr
r
r�send@s	z&has_yield_from_bug.<locals>.MyGen.sendN)�__name__�
__module__�__qualname__rrrrr
r
r
r�MyGen9srcss
|EdHdS)Nr
)�genr
r
r�yield_from_genCsz*has_yield_from_bug.<locals>.yield_from_genr��)rrr)�nextrr)rr�valuer�coror
r
r�has_yield_from_bug8s
	

r"cCs
t|d�S)N)�CoroWrapper)rr
r
r�
debug_wrapperOsr$c@s3eZdZddd�Zdd�Zdd�Zdd	�ZerTd
d�Zndd�Zddd
d�Z	dd�Z
edd��Zedd��Z
edd��Zejr#dd�Zedd��Zedd��Zedd��Zedd ��Zed!d"��Zd#d$�ZdS)%r#NcCs[||_||_tjtjd��|_t|dd�|_t|dd�|_	dS)Nrrr)
rr�	traceback�
extract_stack�sys�	_getframe�_source_traceback�getattrrr)rrrr
r
rrZs
		zCoroWrapper.__init__cCsRt|�}|jr>|jd}|d|d|df7}d|jj|fS)Nrz, created at %s:%srz<%s %s>���)�_format_coroutiner)�	__class__r)r�	coro_repr�framer
r
r�__repr__bs
	
zCoroWrapper.__repr__cCs|S)Nr
)rr
r
rriszCoroWrapper.__iter__cCs|jjd�S)N)rr)rr
r
rrlszCoroWrapper.__next__cGsHtj�}|j}|jj|jtkr8|d}|jj|�S)Nr)	r'r(�f_back�f_code�co_code�f_lasti�_YIELD_FROMrr)rr r/Zcallerr
r
rrts
	
zCoroWrapper.sendcCs|jj|�S)N)rr)rr r
r
rr|scCs|jj|||�S)N)r�throw)r�typer r%r
r
rr6szCoroWrapper.throwcCs
|jj�S)N)r�close)rr
r
rr8�szCoroWrapper.closecCs
|jjS)N)r�gi_frame)rr
r
rr9�szCoroWrapper.gi_framecCs
|jjS)N)r�
gi_running)rr
r
rr:�szCoroWrapper.gi_runningcCs
|jjS)N)r�gi_code)rr
r
rr;�szCoroWrapper.gi_codecCs@t|jdd�}|dk	r<tdj|j|���|S)N�cr_awaitz;Cannot await on coroutine {!r} while it's awaiting for {!r})r*r�RuntimeError�format)rr<r
r
r�	__await__�szCoroWrapper.__await__cCs
|jjS)N)r�gi_yieldfrom)rr
r
rr@�szCoroWrapper.gi_yieldfromcCs
|jjS)N)rr<)rr
r
rr<�szCoroWrapper.cr_awaitcCs
|jjS)N)r�
cr_running)rr
r
rrA�szCoroWrapper.cr_runningcCs
|jjS)N)r�cr_code)rr
r
rrB�szCoroWrapper.cr_codecCs
|jjS)N)r�cr_frame)rr
r
rrC�szCoroWrapper.cr_framecCs�t|dd�}t|dd�}|dkrBt|dd�}|dk	r�|jd	kr�d|}t|df�}|r�djtj|��}|d7}||j�7}tj|�dS)
Nrr9rCrz%r was never yielded fromr)�z6
Coroutine object created at (most recent call last):
r+)r*r4�joinr%�format_list�rstripr	�error)rrr/�msg�tbr
r
r�__del__�s

zCoroWrapper.__del__)rrrrr0rr�_YIELD_FROM_BUGrr6r8�propertyr9r:r;rZPY35r?r@r<rArBrCrKr
r
r
rr#Ws(	r#cs�t��r�Stj��r(��n!tj���fdd���tsstdkrd�}q�t��}n$tj����fdd��}t|_|S)Nc?s��||�}tj|�s<tj|�s<t|t�rJ|EdH}nKtdk	r�y
|j}Wntk
rwYnXt|t�r�|�EdH}|S)N)	rZisfuture�inspectZisgenerator�
isinstancer#�
_AwaitableABCr?�AttributeError)�args�kw�resZ
await_meth)rr
rr!�s

zcoroutine.<locals>.corocs\t�||�d��}|jr.|jd=t�dd�|_t�dd�|_|S)Nrrrrr+)r#r)r*rr)rR�kwds�w)r!rr
r�wrapper�s	
zcoroutine.<locals>.wrapper)�_inspect_iscoroutinefunctionrN�isgeneratorfunction�	functools�wraps�_DEBUG�_types_coroutine�
_is_coroutine)rrWr
)r!rrr�s	!	$
	cCs"t|dd�tkp!t|�S)Nr^)r*r^rX)rr
r
rr�scCs
t|t�S)N)rO�_COROUTINE_TYPES)�objr
r
rrsc
"Csft|d�r�t|d�r�t|dt|dt|�j��}dj|�}d}y
|j}Wn4tk
r�y
|j}Wntk
r�YnXYnX|r�dj|�S|Sd}t|t	�r�|j
}|j}|dk	rdj|�}n|}|dkr#tj
|fi�}y
|j}Wntk
rM|j}YnXy
|j}Wntk
rx|j}YnX|j}d}t|t	�rtj|j
�r|j
dk	rtj|j
�}|dk	r�|\}}|dkrd	|||f}	qbd
|||f}	nG|dk	rF|j}d|||f}	n|j}d	|||f}	|	S)NrBr;rrz{}()Fz
{} runningrz%s done, defined at %s:%sz%s running, defined at %s:%sz%s running at %s:%s)�hasattrr*r7rr>rArQr:rOr#rrrZ_format_callbackr;rBr9rC�co_filenamerNrYZ_get_function_source�f_lineno�co_firstlineno)
r!Z	coro_name�runningrZ	coro_codeZ
coro_frame�filename�lineno�sourcer.r
r
rr,sl 





		



			r,)-�__all__rZrNZopcode�osr'r%�typesrDrrr�logr	Zopmapr5�flags�ignore_environment�bool�environ�getr\rr]�
CoroutineTypeZ_types_CoroutineTyperQrrX�collections.abcrZ
_CoroutineABCrrP�ImportErrorr"rLr$r#�objectr^�
GeneratorTyper_rr,r
r
r
r�<module>sX

	




	i:	



?>