AlkantarClanX12

Your IP : 18.117.70.64


Current Path : /opt/alt/python35/lib64/python3.5/multiprocessing/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/multiprocessing/__pycache__/reduction.cpython-35.opt-2.pyc



���]��@s�ddlZddlZddlZddlZddlZddlZddlZddlmZdddddgZ	ej
d	kp�eed
�o�eed�o�eejd�ZGd
d�dej
�ZejZddd�Zej
d	krfe	dddg7Z	ddlZdddd�Zdd�Zdd�Zdd�ZGdd�de�Znje	dddg7Z	ddlZej
dkZdd�Zdd�Zdd�Zdd�Zd d�Zd!d"�ZGd#d$�d$�Zeee�j �e�d%d&�Z!eee"j#�e!�eee$j%�e!�d'd(�Z&d)d*�Z'eej(e&�ej
d	kr�d+d,�Z)d-d.�Z*eeje)�n(d/d,�Z)d0d.�Z*eeje)�dS)1�N�)�context�send_handle�recv_handle�ForkingPickler�register�dump�win32�CMSG_LEN�
SCM_RIGHTS�sendmsgcsaeZdZiZejZ�fdd�Zedd��Z	eddd��Z
ejZ�S)rcs9t�j|�|jj�|_|jj|j�dS)N)�super�__init__�_copyreg_dispatch_table�copy�dispatch_table�update�_extra_reducers)�self�args)�	__class__��./opt/alt/python35/lib64/python3.5/reduction.pyr%szForkingPickler.__init__cCs||j|<dS)N)r)�cls�type�reducerrrr*szForkingPickler.registerNcCs,tj�}|||�j|�|j�S)N)�io�BytesIOr�	getbuffer)r�obj�protocol�bufrrr�dumps/szForkingPickler.dumps)
�__name__�
__module__�__qualname__r�copyregrrr�classmethodrr"�pickle�loadsrr)rrr s	cCst||�j|�dS)N)rr)r�filer rrrr9s�	DupHandle�	duplicate�steal_handleFcCs=|dkrtj�}tjtj�||d|tj�S)Nr)�_winapi�GetCurrentProcess�DuplicateHandle�DUPLICATE_SAME_ACCESS)�handleZtarget_process�inheritablerrrr,Fs
cCs]tjtjd|�}z0tj||tj�ddtjtjB�SWdtj|�XdS)NFr)r.�OpenProcess�PROCESS_DUP_HANDLEr0r/r1�DUPLICATE_CLOSE_SOURCE�CloseHandle)Z
source_pidr2Zsource_process_handlerrrr-NscCs&t|tj|�}|j|�dS)N)r+r.r1�send)�connr2�destination_pidZdhrrrrZscCs|j�j�S)N)�recv�detach)r9rrrr_sc@s+eZdZddd�Zdd�ZdS)r+Nc
Cs�|dkrtj�}tjtjd|�}z+tjtj�|||dd�|_Wdtj|�X||_	||_
dS)NFr)�os�getpidr.r4r5r0r/�_handler7�_access�_pid)rr2�access�pid�procrrrres		zDupHandle.__init__c
Cs{|jtj�kr|jStjtjd|j�}z/tj||jtj�|j	dtj
�SWdtj|�XdS)NF)rAr=r>r?r.r4r5r0r/r@r6r7)rrDrrrr<tszDupHandle.detach)r#r$r%rr<rrrrr+cs�DupFd�sendfds�recvfds�darwincCs{tjd|�}tt|�dg�}|j|gtjtj|fg�trw|jd�dkrwt	d��dS)N�i�r�Az%did not receive acknowledgement of fd)
�array�bytes�lenr�socket�
SOL_SOCKETr�ACKNOWLEDGEr;�RuntimeError)�sock�fds�msgrrrrF�s
%cCs(tjd�}|j|}|jdtj|��\}}}}|rW|rWt�y�trm|jd�t|�dkr�t	dt|���|d\}}	}
|tj
kr�|	tjkr�t|
�|jdkr�t�|j
|
�t|�SWnttfk
rYnXt	d��dS)NrIrrKzreceived %d items of ancdatarzInvalid data received)rL�itemsize�recvmsgrOr
�EOFErrorrQr8rNrRrPr�
ValueError�	frombytes�list�
IndexError)rS�size�a�
bytes_sizerU�ancdata�flags�addr�
cmsg_level�	cmsg_type�	cmsg_datarrrrG�s*
'

c
Cs?tj|j�tjtj��}t||g�WdQRXdS)N)rO�fromfd�fileno�AF_UNIX�SOCK_STREAMrF)r9r2r:�srrrr�s$c
Cs@tj|j�tjtj��}t|d�dSWdQRXdS)Nrr)rOrfrgrhrirG)r9rjrrrr�s$cCsatj�}|dk	r.|j|j|��StrQddlm}|j|�Std��dS)Nr)�resource_sharerz&SCM_RIGHTS appears not to be available)r�get_spawning_popenrE�duplicate_for_child�HAVE_SEND_HANDLE�rkrY)�fd�	popen_objrkrrrrE�s
cCsE|jdkr(t|j|jjffSt|j|jjffSdS)N)�__self__�getattrr�__func__r#)�mrrr�_reduce_method�srvc@seZdZdd�ZdS)�_CcCsdS)Nr)rrrr�f�sz_C.fN)r#r$r%rxrrrrrw�srwcCst|j|jffS)N)rs�__objclass__r#)rurrr�_reduce_method_descriptor�srzcCs"t|j|j|jpiffS)N)�_rebuild_partial�funcr�keywords)�prrr�_reduce_partial�srcCstj|||�S)N)�	functools�partial)r|rr}rrrr{�sr{cCs#ddlm}t||�ffS)Nr)�	DupSocket)rkr��_rebuild_socket)rjr�rrr�_reduce_socket�sr�cCs
|j�S)N)r<)Zdsrrrr��sr�cCs1t|j��}t||j|j|jffS)N)rErgr��familyr�proto)rj�dfrrrr��scCs%|j�}tj|||d|�S)Nrg)r<rO)r�r�rr�rprrrr��s)+r&r�rr=r(rO�sysror�__all__�platform�hasattrrn�Picklerrrrr.r,r-rr�objectr+rLrQrFrGrErvrwrrxrzr[�append�int�__add__rr{r�r�r�rrrr�<module>
s^	#