Your IP : 18.223.171.83


Current Path : /opt/alt/python34/lib64/python3.4/asyncio/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib64/python3.4/asyncio/__pycache__/coroutines.cpython-34.pyo

�
j fC%�@s�dddgZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddlm
Z
ddlmZdd	lm
Z
ejd
Zejjo�eejjd��Zy
ejZWnek
r�dZYnXy
ejZWnek
r*dd
�ZYnXyddlmZmZWne k
rcdZZYnXdd�Z!e!�Z"[!dd�Z#Gdd�d�Z$dd�Zdd�Zej%e$fZ&edk	r�e&ef7Z&ndd�Z'dd�Z(dS)�	coroutine�iscoroutinefunction�iscoroutine�N�)�compat)�events)�futures)�loggerZ
YIELD_FROMZPYTHONASYNCIODEBUGcCsdS)NF�)�funcr
r
�7/opt/alt/python34/lib64/python3.4/asyncio/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__6sz*has_yield_from_bug.<locals>.MyGen.__init__cSs|S)Nr
)rr
r
r�__iter__8sz*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�MyGen5srcss
|DdHdS)Nr
)�genr
r
r�yield_from_gen?sz*has_yield_from_bug.<locals>.yield_from_genr��)rrr)�nextrr)rr�valuer�coror
r
r�has_yield_from_bug4s
	

r"cCs
t|d�S)N)�CoroWrapper)rr
r
r�
debug_wrapperKsr$c@s0eZdZddd�Zdd�Zdd�Zdd	�ZerTd
d�Zndd�Zd
d�Z	dd�Z
edd��Zedd��Z
edd��Zejr dd�Zedd��Zedd��Zedd��Zedd ��Zed!d"��Znd#d$�ZdS)%r#NcCs[||_||_tjtjd��|_t|dd�|_t|dd�|_	dS)Nrrr)
rr�	traceback�
extract_stack�sys�	_getframe�_source_traceback�getattrrr)rrrr
r
rrVs
		zCoroWrapper.__init__cCsUt|�}|jrA|jd}|d|d|df7}nd|jj|fS)Nrz, created at %s:%srz<%s %s>���)�_format_coroutiner)�	__class__r)r�	coro_repr�framer
r
r�__repr__^s
	
zCoroWrapper.__repr__cCs|S)Nr
)rr
r
rreszCoroWrapper.__iter__cCs|jjd�S)N)rr)rr
r
rrhszCoroWrapper.__next__cGsKtj�}|j}|jj|jtkr;|d}n|jj|�S)Nr)	r'r(�f_back�f_code�co_code�f_lasti�_YIELD_FROMrr)rr r/Zcallerr
r
rrps
	
zCoroWrapper.sendcCs|jj|�S)N)rr)rr r
r
rrxscCs|jj|�S)N)r�throw)r�excr
r
rr6{szCoroWrapper.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_codecCsCt|jdd�}|dk	r?tdj|j|���n|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�}|dkrEt|dd�}n|dk	r�|jd	kr�d|}t|df�}|r�djtj|��}|d7}||j�7}ntj|�ndS)
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#Ss(	r#cs�t��r�Stj��r(��n!tj���fdd���tsstdkrd�}q�t��}n$tj����fdd��}d|_|S)z�Decorator to mark coroutines.

    If the coroutine is not yielded from before it is destroyed,
    an error message is logged.
    c?s��||�}t|tj�s0tj|�r>|DdH}nQtdk	r�y
|j}Wntk
rkYq�Xt|t�r�|�DdH}q�n|S)N)�
isinstancerZFuture�inspectZisgenerator�
_AwaitableABCr?�AttributeError)�args�kw�resZ
await_meth)rr
rr!�s!

zcoroutine.<locals>.coroNcs_t�||�d��}|jr1|jd=nt�dd�|_t�dd�|_|S)Nrrrrr+)r#r)r*rr)rR�kwds�w)r!rr
r�wrapper�s	
zcoroutine.<locals>.wrapperT)�_inspect_iscoroutinefunctionrO�isgeneratorfunction�	functools�wraps�_DEBUG�_types_coroutine�
_is_coroutine)rrWr
)r!rrr�s	!	$
	cCst|dd�pt|�S)z6Return True if func is a decorated coroutine function.r^F)r*rX)rr
r
rr�scCs
t|t�S)z)Return True if obj is a coroutine object.)rN�_COROUTINE_TYPES)�objr
r
rr�sc	Cs�d}t|t�rH|j}|j}|dk	rNdj|�}qNn|}|dkrotj|f�}ny
|j}Wntk
r�|j	}YnXy
|j
}Wntk
r�|j}YnX|j}d}t|t�rjt
j|j�rj|jdk	rjtj|j�}|dk	r2|\}}n|dkrTd|||f}q�d|||f}nG|dk	r�|j}d|||f}n|j}d|||f}|S)Nz{}()rz%s done, defined at %s:%sz%s running, defined at %s:%sz%s running at %s:%s)rNr#rrr>rZ_format_callbackr;rQrBr9rC�co_filenamerOrYZ_get_function_source�f_lineno�co_firstlineno)	r!Z	coro_namerZ	coro_codeZ
coro_frame�filename�lineno�sourcer.r
r
rr,sL		



			r,))�__all__rZrOZopcode�osr'r%�typesrDrrr�logr	Zopmapr5�flags�ignore_environment�bool�environ�getr\rr]rQrrXZcollections.abcrZ
_CoroutineABCrrP�ImportErrorr"rLr$r#�
GeneratorTyper_rr,r
r
r
r�<module>sN






	i8

?>