????

Your IP : 3.140.253.87


Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/contextlib2/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/contextlib2/__pycache__/__init__.cpython-311.pyc

�

Ifl����dZddlZddlZddlZddlZddlmZddlmZddl	m
Z
	ddl	mZn#e$rGd�d��ZYnwxYwgd	�Z
e
d
gz
Z
Gd�dej��ZGd
�dej��ZGd�de��ZGd�de��ZGd�d��ZGd�deee��ZGd�deee��Zd�Zd�ZGd�de��ZGd�de��ZGd�d e��ZGd!�d"e��ZGd#�d$e��ZGd%�d&e��ZGd'�d(��ZGd)�d*ee��Z Gd+�d,ee��Z!Gd-�d.ee��Z"Gd/�d
e ��Z#dS)0zAcontextlib2 - backports and enhancements to the contextlib module�N)�deque��wraps��
MethodType)�GenericAliasc��eZdZdS)rN)�__name__�
__module__�__qualname__���e/builddir/build/BUILD/cloudlinux-venv-1.0.5/venv/lib/python3.11/site-packages/contextlib2/__init__.pyrrs�������rr)
�asynccontextmanager�contextmanager�closing�nullcontext�AbstractContextManager�AbstractAsyncContextManager�AsyncExitStack�ContextDecorator�	ExitStack�redirect_stdout�redirect_stderr�suppress�aclosing�ContextStackc�d�eZdZdZee��Zd�Zej	d���Z
ed���ZdS)rz,An abstract base class for context managers.c��|S�z0Return `self` upon entering the runtime context.r
��selfs r�	__enter__z AbstractContextManager.__enter__"s���rc��dS�z9Raise any exception triggered within the runtime context.Nr
�r"�exc_type�	exc_value�	tracebacks    r�__exit__zAbstractContextManager.__exit__&s	���trc�N�|turtj|dd��StS)Nr#r*)r�_collections_abc�_check_methods�NotImplemented��cls�Cs  r�__subclasshook__z'AbstractContextManager.__subclasshook__+s)���(�(�(�#�2�1�k�:�N�N�N��rN)r
rr�__doc__�classmethodr�__class_getitem__r#�abc�abstractmethodr*r2r
rrrrss������6�6�#��L�1�1�����	�����������[���rrc�d�eZdZdZee��Zd�Zej	d���Z
ed���ZdS)rz9An abstract base class for asynchronous context managers.c��
K�|Sr r
r!s r�
__aenter__z&AbstractAsyncContextManager.__aenter__8s�����rc��
K�dSr%r
r&s    r�	__aexit__z%AbstractAsyncContextManager.__aexit__<s
�����trc�N�|turtj|dd��StS)Nr:r<)rr,r-r.r/s  rr2z,AbstractAsyncContextManager.__subclasshook__As3���-�-�-�#�2�1�l�3>�@�@�
@��rN)r
rrr3r4rr5r:r6r7r<r2r
rrrr2ss������C�C�#��L�1�1�����	�����������[���rrc�$�eZdZdZd�Zd�Zd�ZdS)rzJA base class or mixin that enables context managers to work as decorators.c�^�tjdt��|���S)a�Returns the context manager used to actually wrap the call to the
        decorated function.

        The default implementation just returns *self*.

        Overriding this method allows otherwise one-shot context managers
        like _GeneratorContextManager to support use as decorators via
        implicit recreation.

        DEPRECATED: refresh_cm was never added to the standard library's
                    ContextDecorator API
        z2refresh_cm was never added to the standard library)�warnings�warn�DeprecationWarning�_recreate_cmr!s r�
refresh_cmzContextDecorator.refresh_cmLs0��	�
�J�(�	*�	*�	*�� � �"�"�"rc��|S)a6Return 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.
        r
r!s rrCzContextDecorator._recreate_cm]s	���rc�@���t�����fd���}|S)Nc�p������5�|i|��cddd��S#1swxYwYdS�N�rC��args�kwds�funcr"s  ��r�innerz(ContextDecorator.__call__.<locals>.innerjs�����"�"�$�$�
+�
+��t�T�*�T�*�*�
+�
+�
+�
+�
+�
+�
+�
+�
+�
+�
+�
+����
+�
+�
+�
+�
+�
+s�+�/�/r�r"rMrNs`` r�__call__zContextDecorator.__call__is9����	�t���	+�	+�	+�	+�	+�
��	+��rN)r
rrr3rDrCrPr
rrrrIsG������P�P�#�#�#�"
�
�
�����rrc��eZdZdZd�Zd�ZdS)�AsyncContextDecoratorzPA base class or mixin that enables async context managers to work as decorators.c��|S)z-Return a recreated instance of self.
        r
r!s rrCz"AsyncContextDecorator._recreate_cmts	���rc�@���t�����fd���}|S)Nc���K�����4�d{V���|i|���d{V��cddd���d{V��S#1�d{V��swxYwYdSrHrIrJs  ��rrNz-AsyncContextDecorator.__call__.<locals>.innerzs�������(�(�*�*�
1�
1�
1�
1�
1�
1�
1�
1�!�T�4�0�4�0�0�0�0�0�0�0�0�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1����
1�
1�
1�
1�
1�
1s�?�
A	�A	rrOs`` rrPzAsyncContextDecorator.__call__ys9����	�t���	1�	1�	1�	1�	1�
��	1��rN)r
rrr3rCrPr
rrrRrRqs8������V�V����
����rrRc��eZdZdZd�ZdS)�_GeneratorContextManagerBasezBShared functionality for @contextmanager and @asynccontextmanager.c��||i|��|_|||c|_|_|_t	|dd��}|�t|��j}||_dS)Nr3)�genrMrKrL�getattr�typer3)r"rMrKrL�docs     r�__init__z%_GeneratorContextManagerBase.__init__�s]���4��&��&�&���*.��d�'��	�4�9�d�i��d�I�t�,�,���;��t�*�*�$�C�����rN)r
rrr3r]r
rrrWrW�s)������L�L�����rrWc�$�eZdZdZd�Zd�Zd�ZdS)�_GeneratorContextManagerz%Helper for @contextmanager decorator.c�N�|�|j|j|j��SrH��	__class__rMrKrLr!s rrCz%_GeneratorContextManager._recreate_cm�� ���~�~�d�i���D�I�>�>�>rc�t�|`|`|`	t|j��S#t
$rt
d��d�wxYw�Nzgenerator didn't yield)rKrLrM�nextrY�
StopIteration�RuntimeErrorr!s rr#z"_GeneratorContextManager.__enter__�sU��
�I�t�y�$�)�	C����>�>�!���	C�	C�	C��7�8�8�d�B�	C���s��7c��|�5	t|j��td���#t$rYdSwxYw|�
|��}	|j�|||��nj#t$r}||ucYd}~Sd}~wt$r(}||urYd}~dS|tur|j|urYd}~dS�d}~wt
j��d|urYdS�xYwtd���)N�generator didn't stopF�z#generator didn't stop after throw())rfrYrhrg�throw�	__cause__�sys�exc_info)r"r[�valuer)�excs     rr*z!_GeneratorContextManager.__exit__�sC���<�
<��T�X����#�#:�;�;�;��!�
�
�
��u�u�
����
�}������
�����t�U�I�6�6�6�6�� �
(�
(�
(��%�'�'�'�'�'�'�'������	
�	
�	
��%�<�<� �5�5�5�5�5��=�(�(�S�]�e�-C�-C� �5�5�5�5�5������
��<�>�>�!�$��-�-� �5�5������D�E�E�EsH�'�
5�5�A"�"
C	�,A5�/C	�5
C	�B%�B%�$B%�% C	�C	N)r
rrr3rCr#r*r
rrr_r_�sQ������0�/�?�?�?�C�C�C�-F�-F�-F�-F�-Frr_c�$�eZdZdZd�Zd�Zd�ZdS)�_AsyncGeneratorContextManagerz Helper for @asynccontextmanager.c�N�|�|j|j|j��SrHrar!s rrCz*_AsyncGeneratorContextManager._recreate_cm�rcrc��K�	|j����d{V��S#t$rtd��d�wxYwre)rY�	__anext__�StopAsyncIterationrhr!s rr:z(_AsyncGeneratorContextManager.__aenter__�sb����	C���+�+�-�-�-�-�-�-�-�-�-��!�	C�	C�	C��7�8�8�d�B�	C���s�#�>c���K�|�@	|j����d{V��td���#t$rYdSwxYw|�
|��}	|j�|||���d{V��td���#t$r}||ucYd}~Sd}~wt$r;}||urYd}~dSt|ttf��r|j|urYd}~dS�d}~wt$r}||ur�Yd}~dSd}~wwxYw)Nrjz$generator didn't stop after athrow()F)	rYrvrhrw�athrow�
isinstancergrm�
BaseException)r"�typrpr)rqs     rr<z'_AsyncGeneratorContextManager.__aexit__�s������;�
<��h�(�(�*�*�*�*�*�*�*�*�*�#�#:�;�;�;��&�
�
�
����
����
�}������
��h�o�o�c�5�)�<�<�<�<�<�<�<�<�<�"�#I�J�J�J��%�
(�
(�
(��%�'�'�'�'�'�'�'������
�
�
��%�<�<� �5�5�5�5�5��e�m�5G�%H�I�I�%��}��-�-�$�u�u�u�u�u������ �
�
�
��e�#�#��$�#�#�#�#�#�����
���sQ�4�
A�A�1B�
C6�
B�C6�
C6�#C�-%C�C�
C6�&C1�1C6N)r
rrr3rCr:r<r
rrrsrs�sL������+�*�?�?�?�C�C�C�!�!�!�!�!rrsc�<��t����fd���}|S)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�&��t�||��SrH)r_�rKrLrMs  �r�helperzcontextmanager.<locals>.helper's���'��d�D�9�9�9rr�rMr�s` rrrs3���6�4�[�[�:�:�:�:��[�:��Mrc�<��t����fd���}|S)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>
    c�&��t�||��SrH)rsrs  �rr�z#asynccontextmanager.<locals>.helperHs���,�T�4��>�>�>rrr�s` rrr-s3���6�4�[�[�?�?�?�?��[�?��Mrc�$�eZdZdZd�Zd�Zd�ZdS)ra2Context 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��||_dSrH��thing�r"r�s  rr]zclosing.__init___�
����
�
�
rc��|jSrHr�r!s rr#zclosing.__enter__as
���z�rc�8�|j���dSrH)r��close�r"ros  rr*zclosing.__exit__cs���
�������rN�r
rrr3r]r#r*r
rrrrNsK�������� ����������rrc�$�eZdZdZd�Zd�Zd�ZdS)ra�Async 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()

    c��||_dSrHr�r�s  rr]zaclosing.__init__yr�rc��K�|jSrHr�r!s rr:zaclosing.__aenter__{s�����z�rc��HK�|j����d{V��dSrH)r��acloser�s  rr<zaclosing.__aexit__}s2�����j���!�!�!�!�!�!�!�!�!�!�!rN)r
rrr3r]r:r<r
rrrrgsK��������"������"�"�"�"�"rrc�$�eZdZdZd�Zd�Zd�ZdS)�_RedirectStreamNc�"�||_g|_dSrH)�_new_target�_old_targets)r"�
new_targets  rr]z_RedirectStream.__init__�s��%�������rc��|j�tt|j����tt|j|j��|jSrH)r��appendrZrn�_stream�setattrr�r!s rr#z_RedirectStream.__enter__�sE���� � ���d�l�!;�!;�<�<�<���T�\�4�#3�4�4�4���rc�j�tt|j|j�����dSrH)r�rnr�r��pop�r"�exctype�excinst�exctbs    rr*z_RedirectStream.__exit__�s+����T�\�4�#4�#8�#8�#:�#:�;�;�;�;�;r)r
rrr�r]r#r*r
rrr�r��sF�������G����
 � � �
<�<�<�<�<rr�c��eZdZdZdZdS)raAContext 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)
    �stdoutN�r
rrr3r�r
rrrr�s������
�
��G�G�Grrc��eZdZdZdZdS)rzCContext manager for temporarily redirecting stderr to another file.�stderrNr�r
rrrr�s������M�M��G�G�Grrc�$�eZdZdZd�Zd�Zd�ZdS)ra?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
    c��||_dSrH)�_exceptions)r"�
exceptionss  rr]zsuppress.__init__�s��%����rc��dSrHr
r!s rr#zsuppress.__enter__�����rc�4�|duot||j��SrH)�
issubclassr�r�s    rr*zsuppress.__exit__�s!���d�"�L�z�'�4�;K�'L�'L�LrNr�r
rrrr�sP��������&�&�&�
�
�
�
M�
M�
M�
M�
Mrrc�j�eZdZdZed���Zed���Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
d�Z
dS)�_BaseExitStackz.A base class for ExitStack and AsyncExitStack.c�"�t||��SrHr��cm�cm_exits  r�_create_exit_wrapperz#_BaseExitStack._create_exit_wrapper�����'�2�&�&�&rc�"�����^�����fd�}|S)Nc�����i���dSrHr
�r'rq�tbrK�callbackrLs   ���r�
_exit_wrapperz8_BaseExitStack._create_cb_wrapper.<locals>._exit_wrapper�s����H�d�#�d�#�#�#�#�#rr
�rKrLr�r�s`` @r�_create_cb_wrapperz!_BaseExitStack._create_cb_wrapper�s9��������4�	$�	$�	$�	$�	$�	$�	$��rc�,�t��|_dSrH)r�_exit_callbacksr!s rr]z_BaseExitStack.__init__�s��$�w�w����rc�r�t|����}|j|_t��|_|S)z@Preserve the context stack by transferring it to a new instance.)r[r�r)r"�	new_stacks  r�pop_allz_BaseExitStack.pop_all�s0���D��J�J�L�L�	�$(�$8�	�!�$�w�w����rc��t|��}	|j}|�||��n%#t$r|�|��YnwxYw|S)aRegisters 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).
        )r[r*�
_push_cm_exit�AttributeError�_push_exit_callback�r"�exit�_cb_type�exit_methods    r�pushz_BaseExitStack.push�su����:�:��	2�"�+�K�

���t�[�1�1�1�1��	�	+�	+�	+��$�$�T�*�*�*�*�*�	+����
�s�/�A�Ac��t|��}|j}|�|��}|�||��|S)z�Enters the supplied context manager.

        If successful, also pushes its __exit__ method as a callback and
        returns the result of the __enter__ method.
        )r[r*r#r��r"r��_cm_type�_exit�results     r�
enter_contextz_BaseExitStack.enter_context�sE����8�8���!���#�#�B�'�'�����2�u�%�%�%��
rc�,�	|^}}}n_#t$rR}t|���d��d}d�|��}t	|��d�d}~wwxYw|j|g|�Ri|��}||_|�|��|S)z\Registers an arbitrary callback and arguments.

        Cannot suppress exceptions.
        �(��"Not enough positional arguments {}N)�
ValueError�str�	partition�format�	TypeErrorr��__wrapped__r��rKrLr"r�rq�exc_details�msgr�s        rr�z_BaseExitStack.callbacks���	+�$(�!�D�(�T�T���	+�	+�	+��c�(�(�,�,�S�1�1�!�4�K�6�=�=�k�J�J�C��C�.�.�d�*�����	+����0��/��H�4�H�H�H�4�H�H�
�%-�
�!�� � ��/�/�/�����
A$�A
A�A$c�^�|�||��}|�|d��dS)z;Helper to correctly register callbacks to __exit__ methods.TN)r�r��r"r�r�r�s    rr�z_BaseExitStack._push_cm_exits3���1�1�"�g�>�>�
�� � ���5�5�5�5�5rTc�>�|j�||f��dSrH)r�r�)r"r��is_syncs   rr�z"_BaseExitStack._push_exit_callbacks$����#�#�W�h�$7�8�8�8�8�8rN)T)r
rrr3�staticmethodr�r�r]r�r�r�r�r�r�r
rrr�r��s�������8�8��'�'��\�'�����\��'�'�'�������(������(6�6�6�
9�9�9�9�9�9rr�c�$�eZdZdZd�Zd�Zd�ZdS)ra�Context 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.
    c��|SrHr
r!s rr#zExitStack.__enter__+s���rc��
�|ddu}tj��d�
�
fd�}d}d}|jrj|j���\}}|sJ�	||�rd}d}d}n6#tj��}||d|d��d}|}YnxYw|j�j|r2	|dj}	|d�#t
$r|	|d_�wxYw|o|S)Nrrkc�F��	|j}||urdS|�|�urn|}�||_dSrH��__context__��new_exc�old_exc�exc_context�	frame_excs   �r�_fix_exception_contextz2ExitStack.__exit__.<locals>._fix_exception_context4�M���
&�%�1���'�)�)��F��&�+��*B�*B��%��
&�#*�G���rFT�NNN�rnror�r�r�r{)r"r��received_excr��suppressed_exc�
pending_raiser��cb�new_exc_details�	fixed_ctxr�s          @rr*zExitStack.__exit__.sA���"�1�~�T�1���L�N�N�1�%�	�	*�	*�	*�	*�	*� ���
��"�
	.��.�2�2�4�4�K�G�R��N�N�N�

.��2�{�#�5�%)�N�$)�M�"4�K���
.�"%�,�.�.��&�&��q�'9�;�q�>�J�J�J� $�
�-��������"�
	.��	�
�(��N�6�	�!�!�n�$�� �
�
�
�-6��A��*��
�����.��.s�A"�"1B�"B7�7Cc�4�|�ddd��dS�z%Immediately unwind the context stack.N)r*r!s rr�zExitStack.close_s���
�
�d�D�$�'�'�'�'�'rN)r
rrr3r#r*r�r
rrrr sL�����������//�//�//�b(�(�(�(�(rrc�h�eZdZdZed���Zed���Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
dS)ra�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.
    c�"�t||��SrHrr�s  r�_create_async_exit_wrapperz)AsyncExitStack._create_async_exit_wrapperrr�rc�"�����^�����fd�}|S)Nc��(�K���i����d{V��dSrHr
r�s   ���rr�z>AsyncExitStack._create_async_cb_wrapper.<locals>._exit_wrapperzs4������(�D�)�D�)�)�)�)�)�)�)�)�)�)�)rr
r�s`` @r�_create_async_cb_wrapperz'AsyncExitStack._create_async_cb_wrappervs9��������4�	*�	*�	*�	*�	*�	*�	*��rc��K�t|��}|j}|�|���d{V��}|�||��|S)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.
        N)r[r<r:�_push_async_cm_exitr�s     r�enter_async_contextz"AsyncExitStack.enter_async_context~s[������8�8���"���*�*�2�.�.�.�.�.�.�.�.��� � ��U�+�+�+��
rc��t|��}	|j}|�||��n&#t$r|�|d��YnwxYw|S)a#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)r[r<rr�r�r�s    r�push_async_exitzAsyncExitStack.push_async_exit�sw����:�:��	8�"�,�K�

�$�$�T�;�7�7�7�7��	�	2�	2�	2��$�$�T�5�1�1�1�1�1�	2����
�s�/� A�Ac�.�	|^}}}n_#t$rR}t|���d��d}d�|��}t	|��d�d}~wwxYw|j|g|�Ri|��}||_|�|d��|S)zfRegisters an arbitrary coroutine function and arguments.

        Cannot suppress exceptions.
        r�r�r�NF)r�r�r�r�r�rr�r�r�s        r�push_async_callbackz"AsyncExitStack.push_async_callback�s���	+�$(�!�D�(�T�T���	+�	+�	+��c�(�(�,�,�S�1�1�!�4�K�6�=�=�k�J�J�C��C�.�.�d�*�����	+����6��5�h�N��N�N�N��N�N�
�%-�
�!�� � ���6�6�6��r�c��DK�|�ddd���d{V��dSr�)r<r!s rr�zAsyncExitStack.aclose�s4�����n�n�T�4��.�.�.�.�.�.�.�.�.�.�.rc�^�|�||��}|�|d��dS)zLHelper to correctly register coroutine function to __aexit__
        method.FN)rr�r�s    rrz"AsyncExitStack._push_async_cm_exit�s5���7�7��G�D�D�
�� � ���6�6�6�6�6rc��
K�|SrHr
r!s rr:zAsyncExitStack.__aenter__�s�����rc����K�|ddu}tj��d��fd�}d}d}|jrv|j���\}}	|r||�}n||��d{V��}|rd}d}d}n6#tj��}	||	d|d��d}|	}YnxYw|j�v|r2	|dj}
|d�#t
$r|
|d_�wxYw|o|S)Nrrkc�F��	|j}||urdS|�|�urn|}�||_dSrHr�r�s   �rr�z8AsyncExitStack.__aexit__.<locals>._fix_exception_context�r�rFTr�r�)r"r�r�r�r�r�r�r��cb_suppressr�r�r�s           @rr<zAsyncExitStack.__aexit__�si�����"�1�~�T�1���L�N�N�1�%�	�	*�	*�	*�	*�	*� ���
��"�	.��.�2�2�4�4�K�G�R�
.��9�"$�"�k�"2�K�K�(*��K�(8�"8�"8�"8�"8�"8�"8�K��5�%)�N�$)�M�"4�K���
.�"%�,�.�.��&�&��q�'9�;�q�>�J�J�J� $�
�-�������#�"�	.�$�	�
�(��N�6�	�!�!�n�$�� �
�
�
�-6��A��*��
�����.��.s�A0�01B#�0C�CN)r
rrr3r�rrrr	rr�rr:r<r
rrrres�������
�
��'�'��\�'�����\��
�
�
����$���(/�/�/�7�7�7����3/�3/�3/�3/�3/rrc�2�eZdZdZdd�Zd�Zd�Zd�Zd�ZdS)	raOContext 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
    Nc��||_dSrH��enter_result)r"rs  rr]znullcontext.__init__�s��(����rc��|jSrHrr!s rr#znullcontext.__enter__s��� � rc��dSrHr
�r"�excinfos  rr*znullcontext.__exit__r�rc��K�|jSrHrr!s rr:znullcontext.__aenter__s����� � rc��
K�dSrHr
rs  rr<znullcontext.__aexit__
s�����rrH)	r
rrr3r]r#r*r:r<r
rrrr�sn��������)�)�)�)�!�!�!�
�
�
�!�!�!�
�
�
�
�
rrc�4��eZdZdZ�fd�Zd�Zd�Zd�Z�xZS)rz+Backwards compatibility alias for ExitStackc���tjdt��tt|�����dS)Nz*ContextStack has been renamed to ExitStack)r@rArB�superrr])r"rbs �rr]zContextStack.__init__s?����
�B�(�	*�	*�	*�
�l�D�!�!�*�*�,�,�,�,�,rc�,�|�|��SrH)r�)r"r�s  r�
register_exitzContextStack.register_exits���y�y��"�"�"rc�$�|j|g|�Ri|��SrH)r�)r"r�rKrLs    r�registerzContextStack.registers$���t�}�X�5��5�5�5��5�5�5rc�*�|���SrH)r�r!s r�preservezContextStack.preserves���|�|�~�~�r)	r
rrr3r]r r"r$�
__classcell__)rbs@rrrsk�������5�5�-�-�-�-�-�
#�#�#�6�6�6�������r)$r3r6rnr@r,�collectionsr�	functoolsr�typesrr�ImportError�__all__�ABCrr�objectrrRrWr_rsrrrrr�rrrr�rrrrr
rr�<module>r-sb��G�G�
�
�
�
�
�
�
�
���������������������������
�"�"�"�"�"�"�"���
�
�
�
�
�
�
�
�
�
�
�
�
�
����I�I�I���N���������S�W����*�����#�'����.%�%�%�%�%�v�%�%�%�P
�
�
�
�
�F�
�
�
� 
�
�
�
�
�
�
�
�$AF�AF�AF�AF�AF�;�5�/�AF�AF�AF�H2�2�2�2�2�$@�$?�$9�2�2�2�j���B���B�����$����2"�"�"�"�"�*�"�"�"�4<�<�<�<�<�,�<�<�<�$
�
�
�
�
�o�
�
�
� �����o����M�M�M�M�M�%�M�M�M�<U9�U9�U9�U9�U9�U9�U9�U9�rA(�A(�A(�A(�A(�� 6�A(�A(�A(�JK/�K/�K/�K/�K/�^�%@�K/�K/�K/�\
�
�
�
�
�(�*E�
�
�
�8�����9�����s�-�A�A