Hacked By AnonymousFox

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

B

YI~d�$�@sddlmZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddddd	gZejd
kp�e
ed�o�e
ed�o�e
ejd
�ZGdd�dej�ZejZd5dd	�Zejd
k�redddg7ZddlZd6dd�Zdd�Zdd�Zdd�ZGdd�de�ZnHedddg7ZddlZejdkZdd�Zdd�Zdd�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.d/�Z,eeje+�nd0d-�Z+d1d/�Z,eeje+�Gd2d3�d3ed4�Z-dS)7�)�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/python37/lib64/python3.7/multiprocessing/reduction.pyr&szForkingPickler.__init__cCs||j|<dS)N)r)�cls�type�reducerrrr+szForkingPickler.registerNcCs t��}|||��|�|��S)N)�io�BytesIOr	�	getbuffer)r�obj�protocol�bufrrr�dumps0szForkingPickler.dumps)N)�__name__�
__module__�__qualname__r�copyregrrr�classmethodrr"�pickle�loads�
__classcell__rr)rrr!scCst||��|�dS)N)rr	)r�filer rrrr	:s�	DupHandle�	duplicate�steal_handleFcCs*|dkrt��}t�t��||d|tj�S)Nr)�_winapi�GetCurrentProcess�DuplicateHandle�DUPLICATE_SAME_ACCESS)�handleZtarget_processZinheritablerrrr-Gs

c	CsBt�tjd|�}z t�||t��ddtjtjB�St�|�XdS)NFr)r/�OpenProcess�PROCESS_DUP_HANDLEr1r0r2�DUPLICATE_CLOSE_SOURCE�CloseHandle)Z
source_pidr3Zsource_process_handlerrrr.Os
cCst|tj|�}|�|�dS)N)r,r/r2�send)�connr3�destination_pidZdhrrrr[scCs|����S)N)�recv�detach)r9rrrr`sc@seZdZddd�Zdd�ZdS)r,Nc	Cs\|dkrt��}t�tjd|�}zt�t��|||dd�|_Wdt�|�X||_	||_
dS)NFr)�os�getpidr/r4r5r1r0�_handler7�_access�_pid)rr3�access�pid�procrrrrfszDupHandle.__init__c	CsV|jt��kr|jSt�tjd|j�}zt�||jt��|j	dtj
�St�|�XdS)NF)rAr=r>r?r/r4r5r1r0r@r6r7)rrDrrrr<us
zDupHandle.detach)N)r#r$r%rr<rrrrr,ds
�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�msgrrrrF�s
c	Cst�d�}|j|}|�dt�|��\}}}}|s:|s:t�y�trJ|�d�t|�dkrft	dt|���|d\}}	}
|tj
kr�|	tjkr�t|
�|jdkr�t�|�
|
�t|�d|dkr�td�t|�|d���t|�SWnttfk
r�YnXt	d��dS)	NrIrrKzreceived %d items of ancdatarrJz Len is {0:n} but msg[0] is {1!r}zInvalid data received)rL�itemsizeZrecvmsgrOZ
CMSG_SPACE�EOFErrorrQr8rNrRrPr�
ValueErrorZ	frombytes�AssertionError�format�list�
IndexError)rS�size�aZ
bytes_sizerTZancdata�flagsZaddrZ
cmsg_levelZ	cmsg_typeZ	cmsg_datarrrrG�s2





c	Cs2t�|��tjtj��}t||g�WdQRXdS)N)rO�fromfd�fileno�AF_UNIX�SOCK_STREAMrF)r9r3r:�srrrr�sc	Cs0t�|��tjtj��}t|d�dSQRXdS)Nrr)rOr_r`rarbrG)r9rcrrrr�scCsFt��}|dk	r |�|�|��Str:ddlm}|�|�Std��dS)Nr)�resource_sharerz&SCM_RIGHTS appears not to be available)rZget_spawning_popenrEZduplicate_for_child�HAVE_SEND_HANDLE�rdrW)�fdZ	popen_objrdrrrrE�s
cCs2|jdkrt|j|jjffSt|j|jjffSdS)N)�__self__�getattrr�__func__r#)�mrrr�_reduce_method�s
rlc@seZdZdd�ZdS)�_CcCsdS)Nr)rrrr�f�sz_C.fN)r#r$r%rnrrrrrm�srmcCst|j|jffS)N)ri�__objclass__r#)rkrrr�_reduce_method_descriptor�srpcCst|j|j|jpiffS)N)�_rebuild_partial�funcr�keywords)�prrr�_reduce_partial�srucCstj|f|�|�S)N)�	functools�partial)rrrrsrrrrq�srqcCsddlm}t||�ffS)Nr)�	DupSocket)rdrx�_rebuild_socket)rcrxrrr�_reduce_socket�srzcCs|��S)N)r<)Zdsrrrry�srycCs"t|���}t||j|j|jffS)N)rEr`ry�familyr�proto)rc�dfrrrrz�scCs|��}tj||||d�S)N)r`)r<rO)r}r{rr|rgrrrry�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�dS)N)rrrmrnrlrZ�appendrp�int�__add__rvrwrurOrz)rrrrrrs
zAbstractReducer.__init__N)r#r$r%rrr	rr�sys�platformr.r-r,rFrGrErlrprqrzryrrrrrr~�s$
r~)�	metaclass)N)NF).�abcrr&rvrr=r(rOr�rfr�__all__r��hasattrreZPicklerrrr	r/r-r.rr�objectr,rLrQrFrGrErlrmrrnrprZrr�r�rurqrwrzryr~rrrr�<module>
sb




#


Hacked By AnonymousFox1.0, Coded By AnonymousFox