HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib64/python3.10/site-packages/billiard/__pycache__/util.cpython-310.pyc
o

!we��@sVddlZddlZddlZddlZzddlZWn
ey#ddlZYnwzddlmZWn
ey9dd�ZYnwddl	m
Z
mZmZm
Z
mZmZmZmZmZmZmZmZmZddlmZgd�Zd	ZdZdZd
ZdZdZd
Z dZ!dZ"dZ#dZ$da%da&dd�Z'dd�Z(dd�Z)dd�Z*dd�Z+dd�Z,dd �Z-d)d!d"�Z.d#d$�Z/d%d&�Z0d'd(�Z1dS)*�N)�_args_from_interpreter_flagscCstddddddddd	d
d�
}g}|��D]\}}ttj|�}|dkr*|�d
||�qtjD]	}|�d|�q.|S)zrReturn a list of command-line arguments reproducing the current
        settings in sys.flags and sys.warnoptions.�d�O�B�s�S�E�v�b�R�3)
�debug�optimize�dont_write_bytecode�no_user_site�no_site�ignore_environment�verbose�
bytes_warning�hash_randomization�py3k_warningr�-z-W)�items�getattr�sys�flags�append�warnoptions)�flag_opt_map�args�flag�optr	�r"�F/home/arjun/projects/env/lib/python3.10/site-packages/billiard/util.pyrs(��
r)
�_afterfork_registry�_afterfork_counter�_exit_function�_finalizer_registry�_finalizer_counter�Finalize�ForkAwareLocal�ForkAwareThreadLock�get_temp_dir�
is_exiting�register_after_fork�_run_after_forkers�_run_finalizers�)�	get_errno)�	sub_debugr
�info�sub_warning�
get_logger�
log_to_stderrr,r.r-r)r+r*�SUBDEBUG�
SUBWARNING���
����(�multiprocessingz+[%(levelname)s/%(processName)s] %(message)sFcO�&trtjt|g|�Ri|��dSdS�N)�_logger�logr8��msgr�kwargsr"r"r#r3`��r3cOrBrC)rDrE�DEBUGrFr"r"r#r
erIr
cOrBrC)rDrE�INFOrFr"r"r#r4jrIr4cOrBrC)rDrEr9rFr"r"r#r5orIr5cOrBrC)rDrE�WARNINGrFr"r"r#�warningsrIrMcOrBrC)rDrE�ERRORrFr"r"r#�errorwrIrOcCs�ddl}|��zMtsH|�t�adt_|�td�|�td�t	t
d�r/t
�t�t
�
t�n t
j�tdif�t
j�tdif�W|��tSW|��tSW|��tS|��w)z0
    Returns logger used by multiprocessing
    rNr8r9�
unregisterr")�logging�_acquireLockrD�	getLogger�LOGGER_NAME�	propagate�addLevelNamer8r9�hasattr�atexitrPr&�register�
_exithandlers�remover�_releaseLock)rQr"r"r#r6|s,


��
�r6cCsJddl}t�}|�t�}|��}|�|�|�|�|r!|�|�dat	S)zB
    Turn on logging and add a handler which prints to stderr
    rNT)
rQr6�	Formatter�DEFAULT_LOGGING_FORMAT�
StreamHandler�setFormatter�
addHandler�setLevel�_log_to_stderrrD)�levelrQ�logger�	formatter�handlerr"r"r#r7�s



r7cCs�tj�d�s	t��z:dtjvr-t��}|�d�|�d�}|�	d�}|�
t|�|dWSt�
�}tj�d�}|�
tt�|��|jWStyMt��w)zE
    Return the current value of the parent process death signal
    �linux�cffi�int prctl (int __option, ...);zint *Nr�	libc.so.6)r�platform�
startswith�OSError�modulesri�FFI�cdef�new�dlopen�prctl�PR_GET_PDEATHSIG�ctypes�c_int�cdll�LoadLibrary�byref�value�	Exception)�ffi�arg�C�sig�libcr"r"r#�
get_pdeathsig�s"




�r�c
Cs�tj�d�s
td��z2dtjvr+t��}|�d�|�d�}|�	t
|�d|��WdStj
�d�}|�	t
t�|��WdStyM}ztd�|�d}~ww)	am
    Set the parent process death signal of the calling process to sig
    (either a signal value in the range 1..maxsig, or 0 to clear).
    This is the signal that the calling process will get when its parent dies.
    This value is cleared for the child of a fork(2) and
    (since Linux 2.4.36 / 2.6.23) when executing a set-user-ID or set-group-ID binary.
    rhz$pdeathsig is only supported on linuxrirjN�intrkz(An error occured while setting pdeathsig)rrlrmrnrorirprqrsrt�PR_SET_PDEATHSIG�castrvrxryrwr|)r�r}rr��er"r"r#�
set_pdeathsig�s



��r�cst����fdd��}|S)z&
    Automatic retry after EINTR.
    c
sJ	z�|i|��WSty#}zt|�tjkr�WYd}~nd}~wwqrC)rnr2�errno�EINTR)rrH�exc��funcr"r#�wrapped�s����z_eintr_retry.<locals>.wrapped)�	functools�wraps)r�r�r"r�r#�_eintr_retry�sr�rC)2rr�r�rXri�ImportErrorrv�
subprocessr�multiprocessing.utilr$r%r&r'r(r)r*r+r,r-r.r/r0�compatr2�__all__rur��NOTSETr8rJrKr9rLrNrTr^rDrcr3r
r4r5rMrOr6r7r�r�r�r"r"r"r#�<module>sR	��<