AlkantarClanX12

Your IP : 18.222.78.65


Current Path : /opt/alt/python38/lib64/python3.8/multiprocessing/__pycache__/
Upload File :
Current File : //opt/alt/python38/lib64/python3.8/multiprocessing/__pycache__/reduction.cpython-38.opt-2.pyc

U

i�f(%�@sddlmZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddddd	gZejd
kp�e
ed�o�e
ed�o�e
ejd
�ZGdd�dej�ZejZd6dd	�Zejd
k�redddg7ZddlZd7dd�dd�Zdd�Zdd�Zdd�ZGdd�de�ZnHedddg7ZddlZejdkZdd�Zdd�Zd d�Zd!d�Zd"d�Zd#d$�ZGd%d&�d&�Z ee!e �j"�e�d'd(�Z#ee!e$j%�e#�ee!e&j'�e#�d)d*�Z(d+d,�Z)eej*e(�ejd
k�r�d-d.�Z+d/d0�Z,eeje+�nd1d.�Z+d2d0�Z,eeje+�Gd3d4�d4ed5�Z-dS)8�)�ABCMetaN�)�context�send_handle�recv_handle�ForkingPickler�register�dump�win32ZCMSG_LEN�
SCM_RIGHTS�sendmsgcsFeZdZiZejZ�fdd�Zedd��Z	eddd��Z
ejZ�Z
S)	rcs*t�j|�|j��|_|j�|j�dS�N)�super�__init__�_copyreg_dispatch_table�copy�dispatch_table�update�_extra_reducers��self�args��	__class__��>/opt/alt/python38/lib64/python3.8/multiprocessing/reduction.pyr&szForkingPickler.__init__cCs||j|<dSr
)r)�cls�type�reducerrrr+szForkingPickler.registerNcCs t��}|||��|�|��Sr
)�io�BytesIOr	�	getbuffer)r�obj�protocolZbufrrr�dumps0szForkingPickler.dumps)N)�__name__�
__module__�__qualname__r�copyregrrr�classmethodrr$�pickle�loads�
__classcell__rrrrr!s
cCst||��|�dSr
)rr	)r"�filer#rrrr	:s�	DupHandle�	duplicate�steal_handleF)�source_processcCs6t��}|dkr|}|dkr |}t�|||d|tj�S)Nr)�_winapi�GetCurrentProcess�DuplicateHandle�DUPLICATE_SAME_ACCESS)�handleZtarget_processZinheritabler1Zcurrent_processrrrr/Gs�c	CsFt�tjd|�}z$t�||t��ddtjtjB�W�St�|�XdS�NFr)r2�OpenProcess�PROCESS_DUP_HANDLE�CloseHandler4r3r5�DUPLICATE_CLOSE_SOURCE)Z
source_pidr6Zsource_process_handlerrrr0Ss�
�cCst|tj|�}|�|�dSr
)r.r2r5�send)�connr6�destination_pidZdhrrrr_scCs|����Sr
)�recv�detach)r=rrrrdsc@seZdZddd�Zdd�ZdS)r.Nc	Cs\|dkrt��}t�tjd|�}zt�t��|||dd�|_W5t�|�X||_	||_
dSr7)�os�getpidr2r8r9r:r4r3�_handle�_access�_pid)rr6�access�pid�procrrrrjs�
zDupHandle.__init__c	CsZ|jt��kr|jSt�tjd|j�}z"t�||jt�	�|j
dtj�W�St�|�XdS)NF)rErArBrCr2r8r9r:r4r3rDr;)rrHrrrr@ys
��zDupHandle.detach)N)r%r&r'rr@rrrrr.hs
�DupFd�sendfds�recvfds�darwincCsVt�d|�}tt|�dg�}|�|gtjtj|fg�trR|�d�dkrRt	d��dS)N�i�r�Az%did not receive acknowledgement of fd)
�array�bytes�lenr�socket�
SOL_SOCKETr�ACKNOWLEDGEr?�RuntimeError)�sockZfds�msgrrrrJ�s
c	Cst�d�}|j|}|�dt�|��\}}}}|s:|s:t�z�trJ|�d�t|�dkrft	dt|���|d\}}	}
|tj
kr�|	tjkr�t|
�|jdkr�t�|�
|
�t|�d|dkr�td�t|�|d���t|�WSWnttfk
r�YnXt	d��dS)	NrMrrOzreceived %d items of ancdatarrNz Len is {0:n} but msg[0] is {1!r}zInvalid data received)rP�itemsizeZrecvmsgrSZ
CMSG_SPACE�EOFErrorrUr<rRrVrTr�
ValueErrorZ	frombytes�AssertionError�format�list�
IndexError)rW�size�aZ
bytes_sizerXZancdata�flagsZaddrZ
cmsg_levelZ	cmsg_typeZ	cmsg_datarrrrK�s<


�
�
��c	Cs2t�|��tjtj��}t||g�W5QRXdSr
)rS�fromfd�fileno�AF_UNIX�SOCK_STREAMrJ)r=r6r>�srrrr�sc
Cs<t�|��tjtj��}t|d�dW5QR�SQRXdS)Nrr)rSrcrdrerfrK)r=rgrrrr�scCsFt��}|dk	r |�|�|��Str:ddlm}|�|�Std��dS)Nr)�resource_sharerz&SCM_RIGHTS appears not to be available)rZget_spawning_popenrIZduplicate_for_child�HAVE_SEND_HANDLE�rhr[)�fdZ	popen_objrhrrrrI�s
cCs2|jdkrt|j|jjffSt|j|jjffSdSr
)�__self__�getattrr�__func__r%��mrrr�_reduce_method�s
rqc@seZdZdd�ZdS)�_CcCsdSr
r)rrrr�f�sz_C.fN)r%r&r'rsrrrrrr�srrcCst|j|jffSr
)rm�__objclass__r%rorrr�_reduce_method_descriptor�srucCst|j|j|jpiffSr
)�_rebuild_partial�funcr�keywords)�prrr�_reduce_partial�srzcCstj|f|�|�Sr
)�	functools�partial)rwrrxrrrrv�srvcCsddlm}t||�ffS)Nr)�	DupSocket)rhr}�_rebuild_socket)rgr}rrr�_reduce_socket�srcCs|��Sr
)r@)Zdsrrrr~�sr~cCs"t|���}t||j|j|jffSr
)rIrdr~�familyr�proto)rg�dfrrrr�scCs|��}tj||||d�S)N)rd)r@rS)r�r�rr�rkrrrr~�sc@s`eZdZeZeZeZeZeZej	dkr4e
Z
eZeZne
Z
eZeZeZeZeZeZeZdd�ZdS)�AbstractReducerr
cGsNttt�j�t�tttj�t�tttj	�t�tt
jt�tt
j
t�dSr
)rrrrrsrqr^�appendru�int�__add__r{r|rzrSrrrrrrs
zAbstractReducer.__init__N)r%r&r'rrr	rr�sys�platformr0r/r.rJrKrIrqrurvrr~rrrrrr��s$
r�)�	metaclass)N)NF).�abcrr(r{rrAr*rSr�rjr�__all__r��hasattrriZPicklerrrr	r2r/r0rr�objectr.rPrUrJrKrIrqrrrrsrur^r�r�r�rzrvr|rr~r�rrrr�<module>
sj

�
�	
�#