add-determinism 0.7.3

RPM buildroot helper to strip nondeterministic bits in files
Documentation
�

Jz`f�lcs"�SrSSKrSSKrSSKrSSKrSSKJr SSKJr SSK	J
r
Jr /SQr"SS\R5r"S	S
\R5r"SS\5r"S
S\5r"SS5r"SS\\\5r"SS\\\5rSrSr"SS\5r"SS\5r"SS\5r"SS\5r"SS \5r"S!S"\5r"S#S$5r"S%S&\\5r"S'S(\\5r "S)S*\\5r!"S+S,\5r"g)-z4Utilities for with-statement contexts.  See PEP 343.iN)�deque��wraps)�
MethodType�GenericAlias)�asynccontextmanager�contextmanager�closing�nullcontext�AbstractContextManager�AbstractAsyncContextManager�AsyncExitStack�ContextDecorator�	ExitStack�redirect_stdout�redirect_stderr�suppress�aclosing�chdirc�f�\rSrSrSr\"\5rSrSr	\
RS5r\S5r
Srg)r	iz,An abstract base class for context managers.�c��U$�z0Return `self` upon entering the runtime context.r��self� �#/usr/lib64/python3.13/contextlib.py�	__enter__Z AbstractContextManager.__enter__s����cs�g�z9Raise any exception triggered within the runtime context.Nr�r�exc_typeZ	exc_value�	traceback�    r�__exit__ZAbstractContextManager.__exit__s��rc�P�U[La[R"USS5$[$)Nrr")r	�_collections_abc�_check_methods�NotImplemented��clsZC�  r�__subclasshook__Z'AbstractContextManager.__subclasshook__"s&���(�(�#�2�2�1�k�:�N�N��rN)�__name__�
__module__�__qualname__�__firstlineno__�__doc__�classmethodr�__class_getitem__�	__slots__r�abc�abstractmethodr"r*�__static_attributes__rrrr	r	sH��6�#�L�1���I��	���������rr	cr)r
i)z9An abstract base class for asynchronous context managers.rc��# �U$7frrrrr�
__aenter__Z&AbstractAsyncContextManager.__aenter__1s
�������c�s# �g7frrrr!r�	__aexit__Z%AbstractAsyncContextManager.__aexit__5s
������cr#)Nr7r9)r
r$r%r&r'r)rr*Z,AbstractAsyncContextManager.__subclasshook__:s-���-�-�#�2�2�1�l�3>�@�
@��rN)r+r,r-r.r/r0rr1r2r7r3r4r9r*r5rrrr
r
)sH��C�#�L�1���I��	���������rr
c�$�\rSrSrSrSrSrSrg)riBzJA base class or mixin that enables context managers to work as decorators.cr)aReturn a recreated instance of self.

Allows an otherwise one-shot context manager like
_GeneratorContextManager to support use as
a decorator via implicit recreation.

This is a private interface just for _GeneratorContextManager.
See issue #11647 for details.
rrrr�_recreate_cmZContextDecorator._recreate_cmEs	���rc�4^^�[T5UU4Sj5nU$)Ncsj>�TR5 T"U0UD6sSSS5 $!,(df   g=f�N�r<��args�kwds�funcr�  ��r�innerZ(ContextDecorator.__call__.<locals>.innerRs1����"�"�$�
+��T�*�T�*�
+�
+�
+�s�$�
2r�rrCrE�`` r�__call__ZContextDecorator.__call__Qs ���	�t��	+�
�	+��rrN�r+r,r-r.r/r<rHr5rrrrrBs��P�
�rrcr;)�AsyncContextDecoratoriYzPA base class or mixin that enables async context managers to work as decorators.cr)z-Return a recreated instance of self.
        rrrrr<Z"AsyncContextDecorator._recreate_cm\s	���rcr=)Nc�s�># �TR5IShv�N T"U0UD6IShv�NsSSS5IShv�N $N%NN	!,IShv�N(df   g=f7fr>r?r@rDrrEZ-AsyncContextDecorator.__call__.<locals>.innerbsR�����(�(�*�
1�
1�!�4�0�4�0�0�
1�
1�
1�0�
1�
1�
1�
1�sP�A�>�A�A�A�A�A�A�A�A�A�A�
A
�A�ArrFrGrrHZAsyncContextDecorator.__call__as ���	�t��	1�
�	1��rrNrIrrrrJrJYs��V��
rrJcr;)�_GeneratorContextManagerBaseiizBShared functionality for @contextmanager and @asynccontextmanager.cs��U"U0UD6UlXUsUlUlUl[	USS5nUc[U5RnX@lg)Nr/)�genrCrArB�getattr�typer/)rrCrArBZdoc�     r�__init__Z%_GeneratorContextManagerBase.__init__lsN����&��&���*.�d�'��	�4�9�d�i��d�I�t�,���;��t�*�$�$�C��rcsd�URURURUR5$r>)Z	__class__rCrArBrrrr<Z)_GeneratorContextManagerBase._recreate_cmzs#���~�~�d�i�i����D�I�I�>�>r)rLrCrArBr/N)r+r,r-r.r/rPr<r5rrrrKrKis��L��?rrKcr;)�_GeneratorContextManageri�z%Helper for @contextmanager decorator.csn�U?U?U?[UR5$![
a
 [
S5Sef=f�Nzgenerator didn't yield)rArBrC�nextrL�
StopIteration�RuntimeErrorrrrrZ"_GeneratorContextManager.__enter__�sD��
�I�t�y�$�)�	C�����>�!���	C��7�8�d�B�	C�s��4csR�Uc"[UR5 [S5eUcU"5nURRU5 [S5e!URR5 f=f![a gf=f![a
nXBLsSnA$SnAf[aDnXBLaX4lSnAg[U[5(aURULaX2lSnAgeSnAf[anXBLaeX4lSnAgSnAff=f!URR5 f=f)N�generator didn't stopFz#generator didn't stop after throw())
rSrLrU�closerTZthrow�
__traceback__�
isinstance�	__cause__�
BaseException�rZtypZvaluer �excrOrr"Z!_GeneratorContextManager.__exit__�s
���;�
%��T�X�X��%�&�'>�?�?��}����#
������u�%�F
!�"�#H�I�I��W�H�H�N�N�$��
!�
��
��!�
(��'�'���
��<�(1�%� ��u�m�4�4��
�
��.�*3�'� ��� �

��#��$-�!���

������� �si�A7�A�B�
D
�A4�7
B�B�
D�B�D�
D�&
C%�5*C%�$C%�%
D�2D�D�
D&�rArCrLrBN)r+r,r-r.r/rr"r5rrrrQrQ�s��
0�C�7!rrQcr;)�_AsyncGeneratorContextManageri�z*Helper for @asynccontextmanager decorator.c�s�# �U?U?U?[UR5IShv�N$N![
a
 [
S5Sef=f7frR)rArBrC�anextrL�StopAsyncIterationrUrrrr7Z(_AsyncGeneratorContextManager.__aenter__�sL���
�I�t�y�$�)�	C��t�x�x��(�(�(��!�	C��7�8�d�B�	C�s%�A�)�'�)�A�)�A�Ac�s�# �Uc*[UR5IShv�N [S5eUcU"5nURRU5IShv�N [S5eNJ!URR5IShv�N f=f![a gf=fNJ![a
nXBLsSnA$SnAf[aJnXBLaX4lSnAg[U[[45(aURULaX2lSnAgeSnAf[anXBLaeX4lSnAgSnAff=f!URR5IShv�N f=f7f)NrVFz$generator didn't stop after athrow())r`rLrU�acloseraZathrowrXrYrTrZr[r\rOrr9Z'_AsyncGeneratorContextManager.__aexit__�s6����;�
,��D�H�H�o�%�%�,�&�'>�?�?��}����#
��h�h�o�o�e�,�,�,�F
(�"�#I�J�J�e&���(�(�/�/�+�+�+��
&�
��
��-��%�
(��'�'���
��<�(1�%� ��u�}�6H�&I�J�J��
�
��.�*3�'� ��� �

��#��$-�!���

���h�h�o�o�'�'�'�s��E�B�A*�B�A,�
E�B&�B$�B&�D/�*B�,B�
B
�B�E�
B!�E� B!�!E�$B&�&
D,�0B8�2D,�3E�8
D,�
D
�E�0D
�E�	D
�

D,�D'�"E�'D,�,E�/E�
E�E�Er^N)r+r,r-r.r/r7r9r5rrrr_r_�s��
5�C�7(rr_c�0^�[T5U4Sj5nU$)a�@contextmanager decorator.

Typical usage:

    @contextmanager
    def some_generator(<arguments>):
        <setup>
        try:
            yield <value>
        finally:
            <cleanup>

This makes this:

    with some_generator(<arguments>) as <variable>:
        <body>

equivalent to this:

    <setup>
    try:
        <variable> = <value>
        <body>
    finally:
        <cleanup>
c�>�[TX5$r>)rQ�rArBrC�  �r�helperZcontextmanager.<locals>.helper/s���'��d�9�9rr�rCrg�` rrrs ���6�4�[�:��:��Mrcrc)a�@asynccontextmanager decorator.

Typical usage:

    @asynccontextmanager
    async def some_async_generator(<arguments>):
        <setup>
        try:
            yield <value>
        finally:
            <cleanup>

This makes this:

    async with some_async_generator(<arguments>) as <variable>:
        <body>

equivalent to this:

    <setup>
    try:
        <variable> = <value>
        <body>
    finally:
        <cleanup>
crdr>)r_rerfrrgZ#asynccontextmanager.<locals>.helperPs���,�T�4�>�>rrrhrirrr5s ���6�4�[�?��?��Mrc�*�\rSrSrSrSrSrSrSrg)riVa
Context to automatically close something at the end of a block.

Code like this:

    with closing(<module>.open(<arguments>)) as f:
        <block>

is equivalent to this:

    f = <module>.open(<arguments>)
    try:
        <block>
    finally:
        f.close()

c��Xlgr>��thing�rrmr)rrPZclosing.__init__g����
rc��UR$r>rlrrrrZclosing.__enter__is���z�z�rcs8�URR5 gr>)rmrW�rZexc_infor)rr"Zclosing.__exit__ks���
�
���rrlN�	r+r,r-r.r/rPrr"r5rrrrrVs��� ��rrcrj)rioarAsync context manager for safely finalizing an asynchronously cleaned-up
resource such as an async generator, calling its ``aclose()`` method.

Code like this:

    async with aclosing(<module>.fetch(<arguments>)) as agen:
        <block>

is equivalent to this:

    agen = <module>.fetch(<arguments>)
    try:
        <block>
    finally:
        await agen.aclose()

crkr>rlrnr)rrPZaclosing.__init__�rorc��"# �UR$7fr>rlrrrr7Zaclosing.__aenter__�s����z�z����
c�sT# �URR5IShv�N gN7fr>)rmrbrqr)rr9Zaclosing.__aexit__�s����j�j���!�!�!�s�(�&�(rlN)	r+r,r-r.r/rPr7r9r5rrrrros���"��"rrcs*�\rSrSrSrSrSrSrSrg)�_RedirectStreami�Nc��Xl/Ulgr>)�_new_target�_old_targets)rZ
new_targetr)rrPZ_RedirectStream.__init__�s��%����rcs��URR[[UR55 [[URUR5 UR$r>)rx�appendrM�sys�_stream�setattrrwrrrrZ_RedirectStream.__enter__�sC����� � ���d�l�l�!;�<���T�\�\�4�#3�#3�4����rcsj�[[URURR	55 gr>)r|rzr{rx�pop)r�exctype�excinst�exctbr!rr"Z_RedirectStream.__exit__�s!����T�\�\�4�#4�#4�#8�#8�#:�;r)rxr{rw)	r+r,r-r.r{rPrr"r5rrrruru�s���G��
 �
<rruc��\rSrSrSrSrSrg)ri�aContext manager for temporarily redirecting stdout to another file.

# How to send help() to stderr
with redirect_stdout(sys.stderr):
    help(dir)

# How to write help() to a file
with open('help.txt', 'w') as f:
    with redirect_stdout(f):
        help(pow)
ZstdoutrN�r+r,r-r.r/r{r5rrrrr�s��
��Grrcr�)ri�zCContext manager for temporarily redirecting stderr to another file.ZstderrrNr�rrrrr�s
��M��Grrcrj)ri�a'Context manager to suppress specified exceptions

After the exception is suppressed, execution proceeds with the next
statement following the with statement.

     with suppress(FileNotFoundError):
         os.remove(somefile)
     # Execution still resumes here if the file was already removed
crkr>��_exceptions)rZ
exceptionsr)rrPZsuppress.__init__�s��%�rc��gr>rrrrrZsuppress.__enter__����rcs��Ucg[XR5(ag[U[5(a#URUR5upEUcgUeg)NTF)Z
issubclassr�ZBaseExceptionGroupZsplit)rr~rr�ZmatchZrest�      rr"Zsuppress.__exit__�sT���?���g�/�/�0�0���g�1�2�2�!�-�-��(8�(8�9�K�E��|���J�rr�Nrrrrrrr�s���&�
�rrcsf�\rSrSrSr\S5r\S5rSrSr	Sr
SrS	rS
r
SSjrSrg
)�_BaseExitStacki�z.A base class for ExitStack and AsyncExitStack.c��[X5$r>�r��cm�cm_exitr)r�_create_exit_wrapperZ#_BaseExitStack._create_exit_wrapper��
���'�&�&rc�^^^�UUU4SjnU$)Ncs>�T"T0TD6 gr>r�rr]ZtbrA�callbackrB�   ���r�
_exit_wrapperZ8_BaseExitStack._create_cb_wrapper.<locals>._exit_wrapper�s����d�#�d�#rr�r�rArBr��``` r�_create_cb_wrapperZ!_BaseExitStack._create_cb_wrapper�s���	$��rcs"�[5Ulgr>)r�_exit_callbacksrrrrPZ_BaseExitStack.__init__�s��$�w��rcsf�[U5"5nURUl[5UlU$)z@Preserve the context stack by transferring it to a new instance.)rNr�r)rZ	new_stackr)r�pop_allZ_BaseExitStack.pop_all�s+����J�L�	�$(�$8�$8�	�!�$�w����rcs��[U5nURnURX5 U$![a UR	U5 U$f=f)z�Registers a callback with the standard __exit__ method signature.

Can suppress exceptions the same way __exit__ method can.
Also accepts any object with an __exit__ method (registering a call
to the method instead of the object itself).
)rNr"�
_push_cm_exit�AttributeError�_push_exit_callback�rZexitZ_cb_typeZexit_methodr!r�pushZ_BaseExitStack.push�sX����:��	2�"�+�+�K�

���t�1�����	+��$�$�T�*���	+�s�,�A�
Acs��[U5nURnURnU"U5nURX5 U$![a( [	SUR
SURS35Sef=f)z�Enters the supplied context manager.

If successful, also pushes its __exit__ method as a callback and
returns the result of the __enter__ method.
�'�.z6' object does not support the context manager protocolN)rNrr"r��	TypeErrorr,r-r��rr�r(Z_enterZ_exitZresultr�r�
enter_contextZ_BaseExitStack.enter_contexts����2�h��	S��]�]�F��L�L�E��������2�%��
���	S��a����/�q��1A�1A�0B�CG�H�I�NR�
S�	S�s�A�2A2cs`�UR"U/UQ70UD6nXlURU5 U$)zLRegisters an arbitrary callback and arguments.

Cannot suppress exceptions.
)r��__wrapped__r��rr�rArBr�rOrr�Z_BaseExitStack.callbacks9��
�/�/��H�4�H�4�H�
�%-�!�� � ��/��rc�J�URX5nURUS5 g)z;Helper to correctly register callbacks to __exit__ methods.TN)r�r��rr�r�r�r!rr�Z_BaseExitStack._push_cm_exit#s"���1�1�"�>�
�� � ���5rcs<�URRX!45 gr>)r�ry)rr��is_syncs   rr�Z"_BaseExitStack._push_exit_callback(s�����#�#�W�$7�8r)r�r�N)T)r+r,r-r.r/�staticmethodr�r�rPr�r�r�r�r�r�r5rrrr�r��sN��8��'��'�����
'���(�&�6�
9rr�crj)r
i-aoContext manager for dynamic management of a stack of exit callbacks.

For example:
    with ExitStack() as stack:
        files = [stack.enter_context(open(fname)) for fname in filenames]
        # All opened files will automatically be closed at the end of
        # the with statement, even if attempts to open files later
        # in the list raise an exception.
crr>rrrrrZExitStack.__enter__8s���rcs�^�USnUSLn[R"5mU4SjnSnSnUR(a]URR5upxUcSnO[	U5X"R
4nU"U6(aSnSnSnUR(aM]U(aURn
UeU=(a U$![an	U"X�5 SnU	nSn	A	NOSn	A	ff=f![a	 W
Ulef=f)N�c�P>�URnUbX!LagUTLaOUnMXlgr>��__context__��new_excZold_excZexc_context�	frame_exc�   �r�_fix_exception_contextZ2ExitStack.__exit__.<locals>._fix_exception_contextB�<����%�1�1���&�+�*@���)�+��%���#*�rF�NNNT�rzZ	exceptionr�r}rNrXr[r�)r�exc_detailsr]�received_excr��suppressed_exc�
pending_raiser��cbr��	fixed_ctxr�s           @rr"ZExitStack.__exit__;s�����!�n���$����M�M�O�	�	*� ���
��"�"��.�.�2�2�4�K�G�

��;�"2�K�"&�s�)�S�2C�2C�"C�K��{�#�%)�N�$)�M��C��"�"�"�$�
� �O�O�	��	��.��.��!�
�&�w�4� $�
����	
��!�
�"+����
�s$�-B9� C�9
C�C�C�C/cs*�URSSS5 g�z%Immediately unwind the context stack.N)r"rrrrWZExitStack.closeqs���
�
�d�D�$�'r)r�N)	r+r,r-r.r/rr"rWr5rrrr
r
-s����4/�l(rr
csb�\rSrSrSr\S5r\S5rSrSr	Sr
SrS	rS
r
SrSrg
)riwa�Async context manager for dynamic management of a stack of exit
callbacks.

For example:
    async with AsyncExitStack() as stack:
        connections = [await stack.enter_async_context(get_connection())
            for i in range(5)]
        # All opened connections will automatically be released at the
        # end of the async with statement, even if attempts to open a
        # connection later in the list raise an exception.
cr�r>r�r�r)r�_create_async_exit_wrapperZ)AsyncExitStack._create_async_exit_wrapper�r�rcr�)Nc�s2># �T"T0TD6IShv�N gN7fr>rr�r�rr�Z>AsyncExitStack._create_async_cb_wrapper.<locals>._exit_wrapper�s�����D�)�D�)�)�)�s���rr�r�r�_create_async_cb_wrapperZ'AsyncExitStack._create_async_cb_wrapper�s���	*��rc�s# �[U5nURnURnU"U5IShv�NnURX5 U$![a( [	SUR
SURS35Sef=fNL7f)z�Enters the supplied async context manager.

If successful, also pushes its __aexit__ method as a callback and
returns the result of the __aenter__ method.
r�r�zC' object does not support the asynchronous context manager protocolN)rNr7r9r�r�r,r-�_push_async_cm_exitr�r�r�enter_async_contextZ"AsyncExitStack.enter_async_context�s�����2�h��	'��^�^�F��M�M�E�
�b�z�!��� � ��+��
��
�	'��a����/�q��1A�1A�0B�CT�U��"&�
'�	'��"�s%�B�A
�B�A?�B�
2A<�<Bcs��[U5nURnURX5 U$![a UR	US5 U$f=f)z�Registers a coroutine function with the standard __aexit__ method
signature.

Can suppress exceptions the same way __aexit__ method can.
Also accepts any object with an __aexit__ method (registering a call
to the method instead of the object itself).
F)rNr9r�r�r�r�r!r�push_async_exitZAsyncExitStack.push_async_exit�sZ����:��	8�"�,�,�K�

�$�$�T�7�����	2��$�$�T�5�1���	2�s�,�A�Acsb�UR"U/UQ70UD6nXlURUS5 U$)zVRegisters an arbitrary coroutine function and arguments.

Cannot suppress exceptions.
F)r�r�r�r�rOr�push_async_callbackZ"AsyncExitStack.push_async_callback�s;��
�5�5�h�N��N��N�
�%-�!�� � ���6��rc�sF# �URSSS5IShv�N gN7fr�)r9rrrrbZAsyncExitStack.aclose�s����n�n�T�4��.�.�.�s�!��!cr�)zDHelper to correctly register coroutine function to __aexit__
method.FN)r�r�r�r!rr�Z"AsyncExitStack._push_async_cm_exit�s$���7�7��D�
�� � ���6rc�r6r>rrrrr7ZAsyncExitStack.__aenter__�s
�����r8c�s^# �USnUSLn[R"5mU4SjnSnSnUR(atURR5upxUcSnO[	U5X"R
4nU(aU"U6n	O
U"U6IShv�Nn	U	(aSnSnSnUR(aMtU(aURnUeU=(a U$NE![an
U"X�5 SnU
nSn
A
NQSn
A
ff=f![a	 WUlef=f7f)Nr�cr�r>r�r�r�rr�Z8AsyncExitStack.__aexit__.<locals>._fix_exception_context�r�rFr�Tr�)
rr�r]r�r�r�r�r�r�Zcb_suppressr�r�r�s
            @rr9ZAsyncExitStack.__aexit__�s�����!�n���$����M�M�O�	�	*� ���
��"�"��.�.�2�2�4�K�G�
��;�"2�K�"&�s�)�S�2C�2C�"C�K��"$�k�"2�K�(*�K�(8�"8�K��%)�N�$)�M��C��"�"�"�,�
� �O�O�	��	��.��.�+#9��!�
�&�w�4� $�
����	
��!�
�"+����
�s`�AD
�2C�C�
C�D
�1D
�9C7�D
�C�
C4�C/�*D
�/C4�4D
�7D
�
D
)r�r�N)r+r,r-r.r/r�r�r�r�r�r�rbr�r7r9r5rrrrrwsR��
��'��'�����
�$�$�/�7��8/rrcs:�\rSrSrSrS
SjrSrSrSrSr	S	r
g)ria7Context manager that does no additional processing.

Used as a stand-in for a normal context manager, when a particular
block of code is only sometimes used with a normal context manager:

cm = optional_cm if condition else nullcontext()
with cm:
    # Perform operation, using optional_cm if condition is True
Ncrkr>��enter_result)rr�r)rrPZnullcontext.__init__s��(�rcrpr>r�rrrrZnullcontext.__enter__s��� � � rcr�r>r�rZexcinfor)rr"Znullcontext.__exit__r�rc�rsr>r�rrrr7Znullcontext.__aenter__s���� � � �rtc�s# �g7fr>rr�r)rr9Znullcontext.__aexit__s����r:r�r>)r+r,r-r.r/rPrr"r7r9r5rrrrrs ���)�!�
�!�
rrcrj)ri"zHNon thread-safe context manager to change the current working directory.crvr>��path�_old_cwd)rr�r)rrPZchdir.__init__%s���	���
rcs��URR[R"55 [R"UR
5 gr>)r�ry�osZgetcwdrr�rrrrZchdir.__enter__)s*���
�
���R�Y�Y�[�)�
������rcs`�[R"URR55 gr>)r�rr�r}r�r)rr"Zchdir.__exit__-s��
������"�"�$�%rr�Nrrrrrrr"s��R���&rr)#r/r3r�rzr$ZcollectionsrZ	functoolsrZtypesrrZ__all__ZABCr	r
ZobjectrrJrKrQr_rrrrrurrrr�r
rrrrrr�<module>r�s9��:�
�	�
����*����S�W�W��0�#�'�'��2�v��.
�F�
� ?�?�0G!� ���G!�RG(� ���G(�T�B�B�$��2"�*�"�4<�,�<�$
�o�
� �o��$�%�$�NQ9�Q9�jF(�� 6�F(�TM/�^�%@�M/�`
�(�*E�
�6&�"�&r