add-determinism 0.7.3

RPM buildroot helper to strip nondeterministic bits in files
Documentation
B

�/g^�*c@s�ddlZddlZddlZddlmZddlmZgZGdd�de�ZGdd�de�Z	Gd	d
�d
e�Z
Gdd�de�ZGd
d�de�Z
Gdd�dej�ZGdd�de
�Zdd�ee�D�e_ejdk�rLGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd�de
�ZGdd�de
�ZGd d!�d!e
�Ze�e�e�d"�Zeed#�Zn8Gd$d�dej�ZGd%d�de
�Zd&e�iZeed&�Zd'd(�Ze��Zd)d*�Zd+d,�Zd-d.�Z dS)/�N�)�process)�	reductionc@�eZdZdS)�ProcessErrorN��__name__�
__module__�__qualname__�r
r
�//usr/lib64/python3.7/multiprocessing/context.pyr�rc@r)�BufferTooShortNrr
r
r
rr
rr
c@r)�TimeoutErrorNrr
r
r
rrrrc@r)�AuthenticationErrorNrr
r
r
rrrrc@sNeZdZeZeZeZeZeej	�Z	eej
�Z
dd�Zdd�ZdCdd�Z
dd	�Zd
d�ZdDd
d�ZdEdd�ZdFdd�Zdd�ZdGdd�ZdHdd�ZdIdd�Zdd�ZdJd d!�Zd"d#�Zd$d%�Zdd&�d'd(�Zdd&�d)d*�Zd+d,�Zd-d.�ZdKd/d0�Zd1d2�Z d3d4�Z!d5d6�Z"dLd7d8�Z#dMd:d;�Z$dNd<d=�Z%e&d>d?��Z'e'j(d@d?��Z'dAdB�Z)dS)O�BaseContextcCs"t��}|dkrtd��n|SdS)z(Returns the number of CPUs in the systemNzcannot determine number of cpus)�os�	cpu_countZNotImplementedError)�selfZnumr
r
rr(s
zBaseContext.cpu_countcCs&ddlm}||��d�}|��|S)z�Returns a manager associated with a running server process

        The managers methods such as `Lock()`, `Condition()` and `Queue()`
        can be used to create shared objects.
        r)�SyncManager��ctx)Zmanagersr�get_contextZstart)rrZmr
r
r�Manager0szBaseContext.ManagerTcC�ddlm}||�S)z1Returns two connection object connected by a piper)�Pipe)�
connectionr)rZduplexrr
r
rr;�zBaseContext.PipecC�ddlm}||��d�S)z#Returns a non-recursive lock objectr)�Lockr)�synchronizerr)rrr
r
rr@rzBaseContext.LockcCr)zReturns a recursive lock objectr)�RLockr)rr r)rr r
r
rr ErzBaseContext.RLockNcC�ddlm}|||��d�S)zReturns a condition objectr)�	Conditionr)rr"r)r�lockr"r
r
rr"JrzBaseContext.ConditionrcCr!)zReturns a semaphore objectr)�	Semaphorer)rr$r)r�valuer$r
r
rr$OrzBaseContext.SemaphorecCr!)z"Returns a bounded semaphore objectr)�BoundedSemaphorer)rr&r)rr%r&r
r
rr&TrzBaseContext.BoundedSemaphorecCr)zReturns an event objectr)�Eventr)rr'r)rr'r
r
rr'YrzBaseContext.EventcC� ddlm}|||||��d�S)zReturns a barrier objectr)�Barrierr)rr)r)rZpartiesZactionZtimeoutr)r
r
rr)^rzBaseContext.BarrierrcCr!)�Returns a queue objectr)�Queuer)�queuesr+r)r�maxsizer+r
r
rr+crzBaseContext.QueuecCr!)r*r)�
JoinableQueuer)r,r.r)rr-r.r
r
rr.hrzBaseContext.JoinableQueuecCr)r*r)�SimpleQueuer)r,r/r)rr/r
r
rr/mrzBaseContext.SimpleQueuer
cCs"ddlm}||||||��d�S)zReturns a process pool objectr)�Pool)�context)Zpoolr0r)rZ	processesZinitializerZinitargsZmaxtasksperchildr0r
r
rr0rs
zBaseContext.PoolcGsddlm}||f|��S)zReturns a shared objectr)�RawValue)�sharedctypesr2)r�typecode_or_type�argsr2r
r
rr2yrzBaseContext.RawValuecCsddlm}|||�S)zReturns a shared arrayr)�RawArray)r3r6)rr4�size_or_initializerr6r
r
rr6~rzBaseContext.RawArray)r#cGs&ddlm}||f|�||��d��S)z$Returns a synchronized shared objectr)�Value�r#r)r3r8r)rr4r#r5r8r
r
rr8�szBaseContext.ValuecCr()z#Returns a synchronized shared arrayr)�Arrayr9)r3r:r)rr4r7r#r:r
r
rr:�szBaseContext.ArraycCs,tjdkr(ttdd�r(ddlm}|�dS)z�Check whether this is a fake forked process in a frozen executable.
        If so then run code specified by commandline and exit.
        �win32ZfrozenFr)�freeze_supportN)�sys�platform�getattr�spawnr<)rr<r
r
rr<�szBaseContext.freeze_supportcCsddlm}|�S)zZReturn package logger -- if it does not already exist then
        it is created.
        r)�
get_logger)�utilrA)rrAr
r
rrA��zBaseContext.get_loggercCr)z8Turn on logging and add a handler which prints to stderrr)�
log_to_stderr)rBrD)rZlevelrDr
r
rrD�rzBaseContext.log_to_stderrcCsddlm}dS)zVInstall support for sending connections and sockets
        between processes
        r)rN)�r)rrr
r
r�allow_connection_pickling�sz%BaseContext.allow_connection_picklingcC�ddlm}||�dS)z�Sets the path to a python.exe or pythonw.exe binary used to run
        child processes instead of sys.executable when using the 'spawn'
        start method.  Useful for people embedding Python.
        r)�set_executableN)r@rH)rZ
executablerHr
r
rrH�szBaseContext.set_executablecCrG)zkSet list of module names to try to load in forkserver process.
        This is really just a hint.
        r)�set_forkserver_preloadN)�
forkserverrI)rZmodule_namesrIr
r
rrI�rCz"BaseContext.set_forkserver_preloadcCsH|dkr|Syt|}Wn"tk
r:td|�d�YnX|��|S)Nzcannot find context for %r)�_concrete_contextsZKeyError�
ValueError�_check_available)r�methodrr
r
rr�szBaseContext.get_contextFcCs|jS�N)�_name�rZ
allow_noner
r
r�get_start_method��zBaseContext.get_start_methodcCstd��dS)Nz+cannot set start method of concrete context)rL�rrNZforcer
r
r�set_start_method�rSzBaseContext.set_start_methodcCst��d�S)z_Controls how objects will be reduced to a form that can be
        shared with other processes.r)�globalsZget�rr
r
r�reducer�szBaseContext.reducercCs|t�d<dS)Nr)rV)rrr
r
rrX��cCsdSrOr
rWr
r
rrM�rSzBaseContext._check_available)TrO�rrZ)NN�rr[)NNr
NrOrO�Fr\)*rrr	rr
rr�staticmethodrZcurrent_processZactive_childrenrrrrr r"r$r&r'r)r+r.r/r0r2r6r8r:r<rArDrFrHrIrrRrUZpropertyrXZsetterrMr
r
r
rrsJ














rc@seZdZdZedd��ZdS)�ProcessNcCst��j�|�SrO)�_default_contextrr^�_Popen)�process_objr
r
rr`�rYzProcess._Popen�rrr	Z
_start_methodr]r`r
r
r
rr^��r^csFeZdZeZdd�Zd
�fdd�	Zddd�Zdd	d
�Zdd�Z�Z	S)�DefaultContextcCs||_d|_dSrO)r_�_actual_context)rr1r
r
r�__init__��zDefaultContext.__init__Ncs0|dkr |jdkr|j|_|jSt��|�SdSrO)rer_Zsuperr)rrN�Z	__class__r
rr�s

zDefaultContext.get_contextFcCs<|jdk	r|std��|dkr,|r,d|_dS|�|�|_dS)Nzcontext has already been set)re�RuntimeErrorrrTr
r
rrU�szDefaultContext.set_start_methodcCs"|jdkr|rdS|j|_|jjSrO)rer_rPrQr
r
rrR�s

zDefaultContext.get_start_methodcCs,tjdkrdgStjr dddgSddgSdS)Nr;r@�forkrJ)r=r>r�HAVE_SEND_HANDLErWr
r
r�get_all_start_methods�s


z$DefaultContext.get_all_start_methodsrOr\r\)
rrr	r^rfrrUrRrlZ
__classcell__r
r
rhrrd�s

rdcCsg|]}|ddkr|�qS)rZ_r
)Z.0Zxr
r
r�
<listcomp>srmr;c@�eZdZdZedd��ZdS)�ForkProcessrjcC�ddlm}||�S�Nr)�Popen)Z
popen_forkrr�rarrr
r
rr`rzForkProcess._PopenNrbr
r
r
rrorcroc@rn)�SpawnProcessr@cCrprq)Zpopen_spawn_posixrrrsr
r
rr`r�SpawnProcess._PopenNrbr
r
r
rrtrcrtc@rn)�ForkServerProcessrJcCrprq)Zpopen_forkserverrrrsr
r
rr` rzForkServerProcess._PopenNrbr
r
r
rrvrcrvc@�eZdZdZeZdS)�ForkContextrjN)rrr	rPror^r
r
r
rrx%rcrxc@rw��SpawnContextr@N�rrr	rPrtr^r
r
r
rrz)rcrzc@seZdZdZeZdd�ZdS)�ForkServerContextrJcCstjstd��dS)Nz%forkserver start method not available)rrkrLrWr
r
rrM0rgz"ForkServerContext._check_availableN)rrr	rPrvr^rMr
r
r
rr|-sr|)rjr@rJrjc@rn)rtr@cCrprq)Zpopen_spawn_win32rrrsr
r
rr`?rruNrbr
r
r
rrt=rcc@rwryr{r
r
r
rrzDrcr@cCst|t_dSrO)rKr_re)rNr
r
r�_force_start_methodQrSr}cCsttdd�S)N�spawning_popen)r?�_tlsr
r
r
r�get_spawning_popenZrSr�cCs
|t_dSrO)rr~)Zpopenr
r
r�set_spawning_popen]rSr�cCs t�dkrtdt|�j��dS)NzF%s objects should only be shared between processes through inheritance)r�riZtyper)Zobjr
r
r�assert_spawning`s
r�)!rr=Z	threadingrErrZ__all__Z	Exceptionrr
rrZobjectrZBaseProcessr^rdZdirr>rortrvrxrzr|rKr_r}Zlocalrr�r�r�r
r
r
rZ<module>sD>'