AlkantarClanX12

Your IP : 3.137.219.68


Current Path : /opt/alt/python39/lib64/python3.9/multiprocessing/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/multiprocessing/__pycache__/reduction.cpython-39.opt-2.pyc

a

R�f(%�@sddlmZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
gd�Zejdkp�e
ed�o�e
ed�o�e
ejd	�ZGd
d�dej�ZejZd8dd
�Zejdk�r�egd�7ZddlZd9dd�dd�Zdd�Zdd�Zdd�ZGdd�de�ZnFegd�7ZddlZej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dk�r�d/d0�Z+d1d2�Z,eeje+�nd3d0�Z+d4d2�Z,eeje+�Gd5d6�d6ed7�Z-dS):�)�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/python39/lib64/python3.9/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
rcCst||��|�dSr
)rr	)r"�filer#rrrr	:sr	)�	DupHandle�	duplicate�steal_handleF)�source_processcCs6t��}|dur|}|dur |}t�|||d|tj�S)Nr)�_winapi�GetCurrentProcess�DuplicateHandle�DUPLICATE_SAME_ACCESS)�handleZtarget_processZinheritabler1Zcurrent_processrrrr/Gs�r/c	CsNt�tjd|�}z,t�||t��ddtjtjB�Wt�|�St�|�0dS�NFr)r2�OpenProcess�PROCESS_DUP_HANDLEr4r3r5�DUPLICATE_CLOSE_SOURCE�CloseHandle)Z
source_pidr6Zsource_process_handlerrrr0Ss�

�
�r0cCst|tj|�}|�|�dSr
)r.r2r5�send)�connr6�destination_pidZdhrrrr_srcCs|����Sr
)�recv�detach)r=rrrrdsrc@seZdZddd�Zdd�ZdS)r.Nc	Csf|durt��}t�tjd|�}z(t�t��|||dd�|_Wt�|�nt�|�0||_	||_
dSr7)�os�getpidr2r8r9r4r3�_handler;�_access�_pid)rr6�access�pid�procrrrrjs
�zDupHandle.__init__c	Csb|jt��kr|jSt�tjd|j�}z*t�||jt��|j	dtj
�Wt�|�St�|�0dS)NF)rErArBrCr2r8r9r4r3rDr:r;)rrHrrrr@ys
�
�
�zDupHandle.detach)N)r%r&r'rr@rrrrr.hs
r.)�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
rJc	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tfy�Yn0t	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:


�
�
��rKcCsFt�|��tjtj��}t||g�Wd�n1s80YdSr
)rS�fromfd�fileno�AF_UNIX�SOCK_STREAMrJ)r=r6r>�srrrr�scCsHt�|��tjtj��}t|d�dWd�S1s:0YdS)Nrr)rSrcrdrerfrK)r=rgrrrr�scCsFt��}|dur |�|�|��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
rIcCs2|jdurt|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|g|�Ri|��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

�
�	
�#