Hacked By AnonymousFox

Current Path : /opt/alt/python37/lib64/python3.7/asyncio/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/asyncio/__pycache__/futures.cpython-37.opt-2.pyc

B

YI~d2�@s�dZddlZddlZddlZddlZddlmZddlmZddlm	Z	ej
Z
ejZejZej
Z
ejZejZejZejdZGdd�d�ZeZd	d
�Zdd�Zd
d�Zdd�Zdd�Zdd�dd�ZyddlZWnek
r�YnXejZZdS))�CancelledError�TimeoutError�InvalidStateError�Future�wrap_future�isfuture�N�)�base_futures)�events)�format_helpersc@s�eZdZeZdZdZdZdZdZ	dZ
dd�dd�Zej
Zdd�Zdd	�Zed
d��Zejdd��Zd
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�dd�Zdd�Zd d!�Zd"d#�Zd$d%�ZeZ dS)&rNF)�loopcCs@|dkrt��|_n||_g|_|j��r<t�t�d��|_	dS)Nr)
r
�get_event_loop�_loop�
_callbacksZ	get_debugr�
extract_stack�sys�	_getframe�_source_traceback)�selfr�r�4/opt/alt/python37/lib64/python3.7/asyncio/futures.py�__init__Gs
zFuture.__init__cCsd�|jjd�|����S)Nz<{} {}>� )�format�	__class__�__name__�join�
_repr_info)rrrr�__repr__Ys
zFuture.__repr__cCsF|js
dS|j}|jj�d�||d�}|jr6|j|d<|j�|�dS)Nz exception was never retrieved)�message�	exception�futureZsource_traceback)�_Future__log_traceback�
_exceptionrrrrZcall_exception_handler)r�exc�contextrrr�__del__]s
zFuture.__del__cCs|jS)N)r")rrrr�_log_tracebackmszFuture._log_tracebackcCst|�rtd��d|_dS)Nz'_log_traceback can only be set to FalseF)�bool�
ValueErrorr")r�valrrrr'qscCs|j}|dkrtd��|S)Nz!Future object is not initialized.)r�RuntimeError)rrrrr�get_loopwszFuture.get_loopcCs&d|_|jtkrdSt|_|��dS)NFT)r"�_state�_PENDING�
_CANCELLED�_Future__schedule_callbacks)rrrr�cancel~s
z
Future.cancelcCsL|jdd�}|sdSg|jdd�<x"|D]\}}|jj|||d�q*WdS)N)r%)rr�	call_soon)rZ	callbacks�callback�ctxrrrZ__schedule_callbacks�szFuture.__schedule_callbackscCs
|jtkS)N)r-r/)rrrr�	cancelled�szFuture.cancelledcCs
|jtkS)N)r-r.)rrrr�done�szFuture.donecCs<|jtkrt�|jtkr td��d|_|jdk	r6|j�|jS)NzResult is not ready.F)r-r/r�	_FINISHEDrr"r#�_result)rrrr�result�s


z
Future.resultcCs,|jtkrt�|jtkr td��d|_|jS)NzException is not set.F)r-r/rr7rr"r#)rrrrr �s

zFuture.exception)r%cCsB|jtkr|jj|||d�n |dkr.t��}|j�||f�dS)N)r%)r-r.rr2�contextvarsZcopy_contextr�append)r�fnr%rrr�add_done_callback�s

zFuture.add_done_callbackcs<�fdd�|jD�}t|j�t|�}|r8||jdd�<|S)Ncs g|]\}}|�kr||f�qSrr)�.0�fr4)r<rr�
<listcomp>�sz/Future.remove_done_callback.<locals>.<listcomp>)r�len)rr<Zfiltered_callbacksZ
removed_countr)r<r�remove_done_callback�s

zFuture.remove_done_callbackcCs4|jtkrtd�|j|���||_t|_|��dS)Nz{}: {!r})r-r.rrr8r7r0)rr9rrr�
set_result�s

zFuture.set_resultcCs^|jtkrtd�|j|���t|t�r,|�}t|�tkr@td��||_t	|_|�
�d|_dS)Nz{}: {!r}zPStopIteration interacts badly with generators and cannot be raised into a FutureT)r-r.rr�
isinstance�type�
StopIteration�	TypeErrorr#r7r0r")rr rrr�
set_exception�s

zFuture.set_exceptionccs,|��sd|_|V|��s$td��|��S)NTzawait wasn't used with future)r6�_asyncio_future_blockingr+r9)rrrr�	__await__szFuture.__await__)!r�
__module__�__qualname__r.r-r8r#rrrIr"rr	Z_future_repr_inforrr&�propertyr'�setterr,r1r0r5r6r9r r=rBrCrHrJ�__iter__rrrrr s4rcCs,y
|j}Wntk
rYnX|�S|jS)N)r,�AttributeErrorr)�futr,rrr�	_get_loops
rRcCs|��rdS|�|�dS)N)r5rC)rQr9rrr�_set_result_unless_cancelledsrScCsN|��r|��|��sdS|��}|dk	r8|�|�n|��}|�|�dS)N)r5r1Zset_running_or_notify_cancelr rHr9rC)�
concurrent�sourcer r9rrr�_set_concurrent_future_state&srVcCsP|��rdS|��r|��n.|��}|dk	r:|�|�n|��}|�|�dS)N)r5r1r rHr9rC)rU�destr r9rrr�_copy_future_state5s
rXcs�t��st�tjj�std��t��s<t�tjj�s<td��t��rLt��nd�t��r`t��nd�dd�����fdd�}����fdd�}��|���|�dS)	Nz(A future is required for source argumentz-A future is required for destination argumentcSs"t|�rt||�n
t||�dS)N)rrXrV)r!�otherrrr�
_set_stateYsz!_chain_future.<locals>._set_statecs2|��r.�dks��kr"���n���j�dS)N)r5r1�call_soon_threadsafe)�destination)�	dest_looprU�source_looprr�_call_check_cancel_s
z)_chain_future.<locals>._call_check_cancelcsJ���r�dk	r���rdS�dks,��kr8��|�n����|�dS)N)r5Z	is_closedr[)rU)rZr]r\r^rr�_call_set_statefsz&_chain_future.<locals>._call_set_state)rrDrTZfuturesrrGrRr=)rUr\r_r`r)rZr]r\rUr^r�
_chain_futureIs

	
ra)rcCs2t|�r|S|dkrt��}|��}t||�|S)N)rr
r
Z
create_futurera)r!rZ
new_futurerrrrss
r)�__all__�concurrent.futuresrTr:Zloggingr�r	r
rrrrrr.r/r7�DEBUGZSTACK_DEBUGrZ	_PyFuturerRrSrVrXrarZ_asyncio�ImportErrorZ_CFuturerrrr�<module>s:
q*


Hacked By AnonymousFox1.0, Coded By AnonymousFox