AlkantarClanX12

Your IP : 3.137.198.143


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

B

YI~dl5�@s�ddlZddlZddlZddlZddlZddlZddlmZddlm	Z	ddddd	d
ddd
ddddddgZ
dZdZdZ
dZdZdZdZdadadd�Zdd�Zdd�Zdd�Zdd	�Zd>d d
�Zd!d"�Zd#d$�Ze�Zd%d&�Zd'd�Ze��Z e�!�Z"d(d)�Z#d*d�Z$iZ%e�!�Z&Gd+d�de'�Z(d?d,d-�Z)d.d
�Z*da+eee)e	j,e	j-fd/d0�Z.e�/e.�Gd1d�de'�Z0Gd2d�dej1�Z2ye�3d3�Z4Wne5k
�r�d4Z4YnXd5d�Z6d6d7�Z7d8d9�Z8d:d;�Z9d<d=�Z:dS)@�N)�_args_from_interpreter_flags�)�process�	sub_debug�debug�info�sub_warning�
get_logger�
log_to_stderr�get_temp_dir�register_after_fork�
is_exiting�Finalize�ForkAwareThreadLock�ForkAwareLocal�close_all_fds_except�SUBDEBUG�
SUBWARNING��
���multiprocessingz+[%(levelname)s/%(processName)s] %(message)sFcGstrtjt|f|��dS)N)�_logger�logr)�msg�args�r�9/opt/alt/python37/lib64/python3.7/multiprocessing/util.pyr,scGstrtjt|f|��dS)N)rr�DEBUG)rrrrrr0scGstrtjt|f|��dS)N)rr�INFO)rrrrrr4scGstrtjt|f|��dS)N)rrr)rrrrrr8scCs|ddl}|��z\tsj|�t�adt_ttd�rFt�t	�t�
t	�n$tj�t	dif�tj�
t	dif�Wd|��XtS)Nr�
unregisterr)�loggingZ_acquireLockrZ	getLogger�LOGGER_NAMEZ	propagate�hasattr�atexitr!�_exit_function�registerZ
_exithandlers�remove�appendZ_releaseLock)r"rrrr	<s



cCsJddl}t�}|�t�}|��}|�|�|�|�|rB|�|�dat	S)NrT)
r"r	Z	Formatter�DEFAULT_LOGGING_FORMATZ
StreamHandlerZsetFormatterZ
addHandlerZsetLevel�_log_to_stderrr)�levelr"Zlogger�	formatterZhandlerrrrr
Ws



cCs tjdkrdSttd�rdSdS)NZlinuxTZgetandroidapilevelF)�sys�platformr$rrrr�#_platform_supports_abstract_socketsls


r0cCs@|sdSt|t�r|ddkSt|t�r4|ddkStd��dS)NFr�z(address type of {address!r} unrecognized)�
isinstance�bytes�str�	TypeError)Zaddressrrr�is_abstract_socket_namespacets

r6cCs&||�t��}|dk	r"d|jd<dS)N�tempdir)r�current_process�_config)�rmtreer7r8rrr�_remove_temp_dir�sr;cCsft��j�d�}|dkrbddl}ddl}|jdd�}td|�tdt	|j
|fdd�|t��jd<|S)Nr7rzpymp-)�prefixzcreated temp directory %si����)r�exitpriority)rr8r9�get�shutil�tempfileZmkdtemprrr;r:)r7r?r@rrrr�s
cCsjtt���}|��xP|D]H\\}}}}y||�Wqtk
r`}ztd|�Wdd}~XYqXqWdS)Nz after forker raised exception %s)�list�_afterfork_registry�items�sort�	Exceptionr)rC�indexZident�func�obj�errr�_run_after_forkers�srJcCs|ttt�t|�|f<dS)N)rB�next�_afterfork_counter�id)rHrGrrrr�sc@sBeZdZd
dd�Zdeeejfdd�Zdd�Z	d	d
�Z
dd�ZdS)rrNcCs�|dk	r&t|t�s&td�|t|����|dk	r>t�||�|_n|dkrNtd��||_	||_
|p`i|_|tt
�f|_t��|_|t|j<dS)Nz3Exitpriority ({0!r}) must be None or int, not {1!s}z+Without object, exitpriority cannot be None)r2�intr5�format�type�weakref�ref�_weakref�
ValueError�	_callback�_args�_kwargsrK�_finalizer_counter�_key�os�getpid�_pid�_finalizer_registry)�selfrH�callbackr�kwargsr=rrr�__init__�s

zFinalize.__init__cCs�y||j=Wntk
r(|d�YnbX|j|�krD|d�d}n$|d|j|j|j�|j|j|j�}d|_|_|_|_|_|SdS)Nzfinalizer no longer registeredz+finalizer ignored because different processz/finalizer calling %s with args %s and kwargs %s)rY�KeyErrorr\rUrVrWrS)r^Zwrr]rr[Zresrrr�__call__�szFinalize.__call__cCsDyt|j=Wntk
r Yn Xd|_|_|_|_|_dS)N)r]rYrbrSrUrVrW)r^rrr�cancel�s
zFinalize.cancelcCs
|jtkS)N)rYr])r^rrr�still_active�szFinalize.still_activec	Cs�y|��}Wnttfk
r(d}YnX|dkr>d|jjSd|jjt|jd|j�f}|jrr|dt|j�7}|j	r�|dt|j	�7}|j
ddk	r�|dt|j
d�7}|dS)	Nz<%s object, dead>z<%s object, callback=%s�__name__z, args=z	, kwargs=rz, exitprority=�>)rS�AttributeErrorr5�	__class__rf�getattrrUrVr4rWrY)r^rH�xrrr�__repr__�s 
zFinalize.__repr__)rNN)rf�
__module__�__qualname__rar]rrZr[rcrdrerlrrrrr�s
c	s�tdkrdS�dkrdd��n�fdd���fdd�tt�D�}|jdd�xX|D]P}t�|�}|dk	rRtd|�y
|�WqRtk
r�d	dl}|��YqRXqRW�dkr�t��dS)
NcSs|ddk	S)Nrr)�prrr�<lambda>�z!_run_finalizers.<locals>.<lambda>cs|ddk	o|d�kS)Nrr)ro)�minpriorityrrrprqcsg|]}�|�r|�qSrr)�.0�key)�frr�
<listcomp>#sz#_run_finalizers.<locals>.<listcomp>T)�reversez
calling %sr)	r]rArDr>rrE�	traceback�	print_exc�clear)rr�keysrt�	finalizerrxr)rurrr�_run_finalizerss$




r}cCstp
tdkS)N)�_exitingrrrrr
8scCs�ts�da|d�|d�|d�|�dk	rzx*|�D] }|jr2|d|j�|j��q2Wx"|�D]}|d|j�|��q^W|d�|�dS)NTzprocess shutting downz2running all "atexit" finalizers with priority >= 0rz!calling terminate() for daemon %szcalling join() for process %sz)running the remaining "atexit" finalizers)r~Zdaemon�nameZ_popenZ	terminate�join)rrr}�active_childrenr8rorrrr&@s	
r&c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
rcCs|��t|tj�dS)N)�_resetrr)r^rrrraqszForkAwareThreadLock.__init__cCs"t��|_|jj|_|jj|_dS)N)�	threadingZLock�_lock�acquire�release)r^rrrr�us

zForkAwareThreadLock._resetcCs
|j��S)N)r��	__enter__)r^rrrr�zszForkAwareThreadLock.__enter__cGs|jj|�S)N)r��__exit__)r^rrrrr�}szForkAwareThreadLock.__exit__N)rfrmrnrar�r�r�rrrrrpsc@seZdZdd�Zdd�ZdS)rcCst|dd��dS)NcSs
|j��S)N)�__dict__rz)rHrrrrp�rqz)ForkAwareLocal.__init__.<locals>.<lambda>)r)r^rrrra�szForkAwareLocal.__init__cCst|�dfS)Nr)rP)r^rrr�
__reduce__�szForkAwareLocal.__reduce__N)rfrmrnrar�rrrrr�s�SC_OPEN_MAX�cCsRt|�dtg}|��x4tt|�d�D] }t�||d||d�q*WdS)N���r)rA�MAXFDrD�range�lenrZ�
closerange)Zfds�irrrr�sc	Cs�tjdkrdSytj��Wnttfk
r4YnXy@t�tjtj�}yt|dd�t_Wnt�|��YnXWnttfk
r�YnXdS)NF)�closefd)	r.�stdin�close�OSErrorrTrZ�open�devnull�O_RDONLY)�fdrrr�_close_stdin�s

r�c	CsTytj��Wnttfk
r&YnXytj��Wnttfk
rNYnXdS)N)r.�stdout�flushrhrT�stderrrrrr�_flush_std_streams�sr�cCstddl}tttt|���}t��\}}z2|�|t�|�gd|dddddddd||ddd�St�	|�t�	|�XdS)NrTr�F)
�_posixsubprocess�tuple�sorted�maprNrZ�pipeZ	fork_exec�fsencoder�)�pathrZpassfdsr�Zerrpipe_readZ
errpipe_writerrr�spawnv_passfds�s

r�cCsDddlm}t��ddlm}|j��t�|�	�|�
�dS)Nr)�support)�
forkserver)Ztestr�rZ_cleanuprr�Z_forkserverZ_stopr}Z
gc_collectZ
reap_children)r�r�rrr�_cleanup_tests�s
r�)N)N);rZ�	itertoolsr.rQr%r��
subprocessr�r�__all__ZNOTSETrrr rr#r*rr+rrrrr	r
r0r6Zabstract_sockets_supportedr;rZWeakValueDictionaryrB�countrLrJrr]rX�objectrr}r
r~r�r8r&r'rZlocalr�sysconfr�rErr�r�r�r�rrrr�<module>
sp



		V
,(