add-determinism 0.7.3

RPM buildroot helper to strip nondeterministic bits in files
Documentation
f

��_��@s�dZddlZddlZddlmZmZmZmZgd�Zdd�dd�Z	d	d
�Z
dd�Zd
d�ZGdd�d�Z
dd�Zdd�ZGdd�d�Ze�ZGdd�de�ZGdd�de�ZdS)z"Subinterpreters High Level Module.�N)�ChannelError�ChannelNotFoundError�ChannelEmptyError�is_shareable)
�Interpreter�get_current�get_main�create�list_all�SendChannel�RecvChannel�create_channel�list_all_channelsrrrrT��isolatedcCstj|d�}t||d�S)z'Return a new (idle) Python interpreter.r)�
_interpretersr	r)r�id�r�2/usr/lib64/python3.10/test/support/interpreters.pyr	sr	cCsdd�t��D�S)z!Return all existing interpreters.cSsg|]}t|��qSr)r)�.0rrrr�
<listcomp>�zlist_all.<locals>.<listcomp>)rr
rrrrr
sr
cCst��}t|�S)z)Return the currently running interpreter.)rrr�rrrrr!srcCst��}t|�S)zReturn the main interpreter.)rrrrrrrr'src@sleZdZdZdd�dd�Zdd�Zdd	�Zd
d�Zedd
��Z	edd��Z
dd�Zdd�Zdd�dd�Z
dS)rzA single Python interpreter.NrcCs.t|ttjf�std|����||_||_dS�Nzid must be an int, got )�
isinstance�intrZ
InterpreterID�	TypeError�_id�	_isolated)�selfrrrrr�__init__0szInterpreter.__init__cCsBtt|j�|jd�}dd�|��D�}t|�j�dd�|��d�S)N)rrcss |]\}}|�d|��VqdS)�=Nr)r�k�vrrr�	<genexpr>8rz'Interpreter.__repr__.<locals>.<genexpr>�(z, �))�dictrrr�items�type�__name__�join)r�data�kwargsrrr�__repr__6szInterpreter.__repr__cCs
t|j�S�N��hashr�rrrr�__hash__;szInterpreter.__hash__cCst|t�stS|j|jkSr/)rr�NotImplementedr�r�otherrrr�__eq__>s
zInterpreter.__eq__cCs|jSr/�rr2rrrrDszInterpreter.idcCs|jdurt�|j�|_|jSr/)rrZis_isolatedrr2rrrrHs
zInterpreter.isolatedcCst�|j�S)z<Return whether or not the identified interpreter is running.)r�
is_runningrr2rrrr9PszInterpreter.is_runningcCst�|j�S)z�Finalize and destroy the interpreter.

        Attempting to destroy the current interpreter results
        in a RuntimeError.
        )rZdestroyrr2rrr�closeTszInterpreter.close)�channelscCst�|j||�dS)zqRun the given source code in the interpreter.

        This blocks the current Python thread until done.
        N)rZ
run_stringr)rZsrc_strr;rrr�run\szInterpreter.run)r*�
__module__�__qualname__�__doc__r r.r3r7�propertyrrr9r:r<rrrrr-s

rcCs"t��}t|�t|�}}||fS)z�Return (recv, send) for a new cross-interpreter channel.

    The channel may be used to pass data safely between interpreters.
    )rZchannel_createrr)�cid�recv�sendrrrr
dsr
cCsdd�t��D�S)z4Return a list of (recv, send) for all open channels.cSsg|]}t|�t|�f�qSr)rr)rrArrrrps�z%list_all_channels.<locals>.<listcomp>)rZchannel_list_allrrrrrns�rc@s<eZdZdZdd�Zdd�Zdd�Zdd	�Zed
d��Z	dS)
�_ChannelEndz/The base class for RecvChannel and SendChannel.cCs(t|ttjf�std|����||_dSr)rrrZ	ChannelIDrr)rrrrrr wsz_ChannelEnd.__init__cCst|�j�dt|j��d�S)Nz(id=r&)r)r*rrr2rrrr.|sz_ChannelEnd.__repr__cCs
t|j�Sr/r0r2rrrr3sz_ChannelEnd.__hash__cCs2t|t�rt|t�s&tSt|t�s&tS|j|jkSr/)rrr4rrr5rrrr7�s


z_ChannelEnd.__eq__cCs|jSr/r8r2rrrr�sz_ChannelEnd.idN)
r*r=r>r?r r.r3r7r@rrrrrrDtsrDc@s.eZdZdZe�dd�dd�Zefdd�ZdS)	rz1The receiving end of a cross-interpreter channel.g{�G�z�?)�	_sentinel�_delaycCs4t�|j|�}||ur0t�|�t�|j|�}q|S)z�Return the next object from the channel.

        This blocks until an object has been sent, if none have been
        sent already.
        )r�channel_recvr�time�sleep)rrErF�objrrrrB�s

zRecvChannel.recvcCs"|turt�|j�St�|j|�S)z�Return the next object from the channel.

        If none have been sent then return the default if one
        is provided or fail with ChannelEmptyError.  Otherwise this
        is the same as recv().
        N)�_NOT_SETrrGr)r�defaultrrr�recv_nowait�szRecvChannel.recv_nowaitN)r*r=r>r?�objectrBrKrMrrrrr�src@s eZdZdZdd�Zdd�ZdS)rz/The sending end of a cross-interpreter channel.cCst�|j|�t�d�dS)z{Send the object (i.e. its data) to the channel's receiving end.

        This blocks until the object is received.
        �N)r�channel_sendrrHrI�rrJrrrrC�szSendChannel.sendcCst�|j|�S)z�Send the object to the channel's receiving end.

        If the object is immediately received then return True
        (else False).  Otherwise this is the same as send().
        )rrPrrQrrr�send_nowait�s	zSendChannel.send_nowaitN)r*r=r>r?rCrRrrrrr�sr)r?rHZ_xxsubinterpretersrrrrr�__all__r	r
rrrr
rrDrNrKrrrrrr�<module>s	7