Your IP : 3.147.48.226
3
\+ � @ s� d ddgZ ddlZddlZddlZddlZddlZddlZddlZddlm Z ddlm
Z
ddlmZ dd lmZ dd
l
mZ ejd Zejj o�eejjd��ZyejZejZW n ek
r� dZdZY nX y
ejZW n ek
r� d
d� ZY nX yddlmZ m!Z" W n e#k
�r* d Z Z"Y nX dd� Z$e$� Z%[$dd� Z&G dd� d�Z'dd � Ze(� Z)dd� Zej*e'fZ+e dk �r�e+e f7 Z+edk �r�efe+ Z+dd� Z,dd� Z-dS )� coroutine�iscoroutinefunction�iscoroutine� N� )�compat)� constants)�events)�base_futures)�loggerZ
YIELD_FROMZPYTHONASYNCIODEBUGc C s dS )NF� )�funcr r �*/usr/lib64/python3.6/asyncio/coroutines.py�<lambda>/ s r )� Coroutine� Awaitablec C sF G dd� d�} dd� }d}| � }||�}t |� |j|� |j|fkS ) Nc @ s, e Zd Zdd� Zdd� Zdd� Zdd� Zd S )
z!has_yield_from_bug.<locals>.MyGenc S s
d | _ d S )N)� send_args)�selfr r r
�__init__; s z*has_yield_from_bug.<locals>.MyGen.__init__c S s | S )Nr )r r r r
�__iter__= s z*has_yield_from_bug.<locals>.MyGen.__iter__c S s dS )N�* r )r r r r
�__next__? s z*has_yield_from_bug.<locals>.MyGen.__next__c W s
|| _ d S )N)r )r Zwhatr r r
�sendA s z&has_yield_from_bug.<locals>.MyGen.sendN)�__name__�
__module__�__qualname__r r r r r r r r
�MyGen: s r c s s | E d H d S )Nr )�genr r r
�yield_from_genD s z*has_yield_from_bug.<locals>.yield_from_genr � � )r r r )�nextr r )r r �valuer �coror r r
�has_yield_from_bug9 s
r# c C s
t | d �S )N)�CoroWrapper)r r r r
�
debug_wrapperP s r% c @ s� e Zd Zd%dd�Zdd� Zdd� Zdd � Zer8d
d� Zndd� Zd&d
d�Z dd� Z
edd� �Zedd� �Z
edd� �Zejr�dd� Zedd� �Zedd� �Zedd� �Zedd � �Zed!d"� �Zd#d$� ZdS )'r$ Nc C sZ t j|�st j|�st|��|| _|| _tjtj d��| _
t|dd �| _t|dd �| _
d S )Nr r r )�inspect�isgeneratorr �AssertionErrorr r r �
extract_stack�sys� _getframe�_source_traceback�getattrr r )r r r r r r
r [ s zCoroWrapper.__init__c C s@ t | �}| jr0| jd }|d|d |d f 7 }d| jj|f S )Nr z, created at %s:%sr z<%s %s>���)�_format_coroutiner, � __class__r )r � coro_repr�framer r r
�__repr__c s
zCoroWrapper.__repr__c C s | S )Nr )r r r r
r j s zCoroWrapper.__iter__c C s | j jd �S )N)r r )r r r r
r m s zCoroWrapper.__next__c G sB t j� }|j}|jdkst�|jj|j tkr6|d }| jj |�S )Nr )
r* r+ �f_back�f_lastir( �f_code�co_code�_YIELD_FROMr r )r r! r2 Zcallerr r r
r u s zCoroWrapper.sendc C s | j j|�S )N)r r )r r! r r r
r } s c C s | j j|||�S )N)r �throw)r �typer! � tracebackr r r
r9 � s zCoroWrapper.throwc C s
| j j� S )N)r �close)r r r r
r<