← back to Atmos Game

assets/gen/.venv/lib/python3.12/site-packages/click/__pycache__/testing.cpython-312.pyc

363 lines

�

c�bjZg��X�UddlmZddlmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZ
ddlmZddlmZddlmZddlmZddlmZdd	lmZe
j,rdd
lmZddlmZe
j6dk(re
j8d
Zded<ne
j8dZded<ee e!e!efZ"ded<Gd�d�Z#ejHd"d��Z%Gd�d�Z&Gd�dejN�Z(Gd�d�Z)Gd�dejT�Z+						d#d�Z,Gd�d�Z-Gd �d!�Z.y)$�)�annotationsN)�
TracebackType�)�_compat)�
formatting)�termui)�utils)�_find_binary_reader)�ReadableBuffer)�Command�win32�syszt.TypeAlias�CaptureMode)r�fd�
ExceptionInfoc�z�eZdZUded<ded<ded<dd�Zdd�Zdd�Zddd	�Zddd
�Zddd�Z	dd�Z
dd
�Zdd�Zy)�EchoingStdin�
t.BinaryIO�_input�_output�bool�_pausedc�.�||_||_d|_y)NF)rrr)�self�input�outputs   �d/Users/macstudio3/Projects/atmos-game/assets/gen/.venv/lib/python3.12/site-packages/click/testing.py�__init__zEchoingStdin.__init__%s�����������c�.�t|j|�S�N)�getattrr�r�xs  r�__getattr__zEchoingStdin.__getattr__*s���t�{�{�A�&�&rc�T�|js|jj|�|Sr!)rr�write)r�rvs  r�_echozEchoingStdin._echo-s ���|�|��L�L���r�"��	rc�V�|j|jj|��Sr!)r)r�read�r�ns  rr+zEchoingStdin.read3s ���z�z�$�+�+�*�*�1�-�.�.rc�V�|j|jj|��Sr!)r)r�read1r,s  rr/zEchoingStdin.read16s ���z�z�$�+�+�+�+�A�.�/�/rc�V�|j|jj|��Sr!)r)r�readliner,s  rr1zEchoingStdin.readline9s ���z�z�$�+�+�.�.�q�1�2�2rc�z�|jj�D�cgc]}|j|���c}Scc}wr!)r�	readlinesr)r#s  rr3zEchoingStdin.readlines<s1��'+�{�{�'<�'<�'>�?�'>�!��
�
�1�
�'>�?�?��?s�8c�@��t�fd��jD��S)Nc3�@�K�|]}�j|����y�wr!)r))�.0r$rs  �r�	<genexpr>z(EchoingStdin.__iter__.<locals>.<genexpr>@s�����7�;�a�D�J�J�q�M�;�s�)�iterr�rs`r�__iter__zEchoingStdin.__iter__?s����7�4�;�;�7�7�7rc�,�t|j�Sr!)�reprrr9s r�__repr__zEchoingStdin.__repr__Bs���D�K�K� � rN)rrrr�return�None)r$�strr>�t.Any)r(�bytesr>rB)�����)r-�intr>rB)r>zlist[bytes])r>zcabc.Iterator[bytes]�r>r@)
�__name__�
__module__�__qualname__�__annotations__rr%r)r+r/r1r3r:r=�rrrr sA����
��
�M��
'��/�0�3�@�8�!rrc#�>K�|�d��yd|_d��d|_y�w)NTF)r)�streams r�_pause_echorMFs����
�~�
����
����s�c�H�eZdZUdZded<ded<ded<dd�Zdd�Zd
d	�Zy
)�
_FDCaptureaVRedirect a file descriptor to a temporary file for capture.

    Saves the current target of *targetfd* via :func:`os.dup`, then
    redirects it to a temporary file via :func:`os.dup2`. On
    :meth:`stop`, restores the original ``fd`` and returns the captured
    bytes. Inspired by Pytest's ``FDCapture``.

    .. versionadded:: 8.4.0
    rD�	_targetfd�saved_fdzt.BinaryIO | None�_tmpfilec�.�||_d|_d|_y�NrC)rPrQrR)r�targetfds  rrz_FDCapture.__init___s��!�����
���
rc���tj|j�|_t	j
d��|_tj|jj�|j�y)Nr)�	buffering)	�os�duprPrQ�tempfile�
TemporaryFilerR�dup2�filenor9s r�startz_FDCapture.startdsG�����t�~�~�.��
� �.�.��;��
�
����
�
�$�$�&����7rc�x�|j�Jd��tj|j|j�tj
|j�d|_|jj
d�|jj�}|jj�d|_|S)Nz!_FDCapture.start() was not calledrCr)rRrXr\rQrP�close�seekr+)r�datas  r�stopz_FDCapture.stopis����}�}�(�M�*M�M�(�
����
�
�t�~�~�.�
���������
��
�
���1���}�}�!�!�#���
�
������
��rN)rUrDr>r?�r>r?)r>rB)rFrGrH�__doc__rIrr^rcrJrrrOrOPs(����N��M����
8�
	rrOc�H��eZdZUdZded<d�fd�Zd�fd�Zd	�fd�Z�xZS)
�BytesIOCopyzdPatch ``io.BytesIO`` to let the written stream be copied to another.

    .. versionadded:: 8.2
    �
io.BytesIO�copy_toc�0��t�|��||_yr!)�superrri)rri�	__class__s  �rrzBytesIOCopy.__init__}s���
������rc�V��t�|��|jj�yr!)rk�flushri�rrls �rrnzBytesIOCopy.flush�s���
��
�������rc�X��|jj|�t�|�|�Sr!)rir'rk)r�brls  �rr'zBytesIOCopy.write�s$��������1���w�}�Q��r)rirhr>r?rd)rqrr>rD)	rFrGrHrerIrrnr'�
__classcell__�rls@rrgrgus$����
���� � rrgc�8�eZdZUdZded<ded<ded<d	d�Zy)
�StreamMixerz�Mixes `<stdout>` and `<stderr>` streams.

    The result is available in the ``output`` attribute.

    .. versionadded:: 8.2
    rhrrg�stdout�stderrc��tj�|_t|j��|_t|j��|_y)N)ri)�io�BytesIOrrgrvrwr9s rrzStreamMixer.__init__�s/���j�j�l���!�$�+�+�6���!�$�+�+�6��rNrd)rFrGrHrerIrrJrrruru�s ���
������7rruc���eZdZUdZded<ded<ded<										d�fd�Zd
d�Zd�fd	�Zedd
��Z	edd��Z
�xZS)�_NamedTextIOWrapperaA :class:`~io.TextIOWrapper` with custom ``name`` and ``mode``
    that does not close its underlying buffer.

    When ``CliRunner`` runs in ``fd`` mode, ``_original_fd`` is patched to
    point at the saved (pre-redirection) ``fd``, so C-level consumers that call
    :meth:`fileno` (like ``faulthandler`` or ``subprocess``) keep working. In
    the default ``sys`` mode ``_original_fd`` stays at ``-1`` and
    :meth:`fileno` raises :exc:`io.UnsupportedOperation`, matching the
    pre-``8.3.3`` behavior.
    r@�_name�_moderD�_original_fdc�P��t�|�|fi|��||_||_d|_yrT)rkrr}r~r)r�buffer�name�mode�kwargsrls     �rrz_NamedTextIOWrapper.__init__�s-���	����*�6�*���
���
���rc��y)z�The buffer this object contains belongs to some other object,
        so prevent the default ``__del__`` implementation from closing
        that buffer.

        .. versionadded:: 8.3.2
        NrJr9s rr`z_NamedTextIOWrapper.close�s�rc�V��|jdk\r|jSt�|�	�S)z�Return the file descriptor of the saved original stream when
        ``CliRunner`` runs in ``fd`` mode. Otherwise delegate to
        :class:`~io.TextIOWrapper`, which raises
        :exc:`io.UnsupportedOperation` for a ``BytesIO``-backed buffer.
        r)rrkr]ros �rr]z_NamedTextIOWrapper.fileno�s,�������!��$�$�$��w�~��rc��|jSr!)r}r9s rr�z_NamedTextIOWrapper.name�����z�z�rc��|jSr!)r~r9s rr�z_NamedTextIOWrapper.mode�r�r)
r�rr�r@r�r@r�rAr>r?rd)r>rDrE)rFrGrHrerIrr`r]�propertyr�r�rrrss@rr|r|�s����	��J��J���
��
��
��	
�
�
�
�
�� ��������rr|c���t|d�r.ttjd|��}|�|St	d��|�d}n!t|t�r|j|�}tj|�S)Nr+zt.IO[t.Any]z.Could not find binary reader for input stream.r)
�hasattrr
�t�cast�	TypeError�
isinstancer@�encoderyrz)r�charsetr(s   r�make_input_streamr��sj���u�f��
 ����
�u�!=�
>��
�>��I��H�I�I��}���	�E�3�	����W�%��
�:�:�e��rc���eZdZUdZded<ded<ded<ded<ded	<d
ed<ded
<ded<	d																	dd�Zedd��Zedd��Zedd��Z	dd�Z
y)�ResultaCHolds the captured result of an invoked CLI script.

    :param runner: The runner that created the result
    :param stdout_bytes: The standard output as bytes.
    :param stderr_bytes: The standard error as bytes.
    :param output_bytes: A mix of ``stdout_bytes`` and ``stderr_bytes``, as the
        user would see  it in its terminal.
    :param return_value: The value returned from the invoked command.
    :param exit_code: The exit code as integer.
    :param exception: The exception that happened if one did.
    :param exc_info: Exception information (exception type, exception instance,
        traceback type).

    .. versionchanged:: 8.2
        ``stderr_bytes`` no longer optional, ``output_bytes`` introduced and
        ``mix_stderr`` has been removed.

    .. versionadded:: 8.0
        Added ``return_value``.
    �	CliRunner�runnerrB�stdout_bytes�stderr_bytes�output_bytesrA�return_valuerD�	exit_code�BaseException | None�	exception�ExceptionInfo | None�exc_infoNc	�t�||_||_||_||_||_||_||_||_yr!�r�r�r�r�r�r�r�r�)	rr�r�r�r�r�r�r�r�s	         rrzResult.__init__s@�����(���(���(���(���"���"��� ��
rc��|jj|jjd�j	dd�S)aThe terminal output as unicode string, as the user would see it.

        .. versionchanged:: 8.2
            No longer a proxy for ``self.stdout``. Now has its own independent stream
            that is mixing `<stdout>` and `<stderr>`, in the order they were written.
        �replace�
�
)r��decoder�r�r�r9s rrz
Result.outputs9��� � �'�'����(;�(;�Y�G�O�O��D�
�	
rc��|jj|jjd�j	dd�S)z&The standard output as unicode string.r�r�r�)r�r�r�r�r�r9s rrvz
Result.stdout&s9��� � �'�'����(;�(;�Y�G�O�O��D�
�	
rc��|jj|jjd�j	dd�S)z�The standard error as unicode string.

        .. versionchanged:: 8.2
            No longer raise an exception, always returns the `<stderr>` string.
        r�r�r�)r�r�r�r�r�r9s rrwz
Result.stderr-s9��� � �'�'����(;�(;�Y�G�O�O��D�
�	
rc��|jrt|j�nd}dt|�j�d|�d�S)N�okay�<� �>)r�r<�typerF)r�exc_strs  rr=zResult.__repr__8s8��*.�.�.�$�t�~�~�&�f���4��:�&�&�'�q��	��3�3rr!)r�r�r�rBr�rBr�rBr�rAr�rDr�r�r�r�r>r?rE)rFrGrHrerIrr�rrvrwr=rJrrr�r��s����*
�����������N�#�#�"�"�*.�!��!��!��	!�
�!��
!��!�(�!�'�!�
�!�(�	
��	
��
��
��
��
�4rr�c�&�eZdZUdZded<ded<ded<ded<d	ed
<					d											dd�Zdd
�Z	d			dd�Zej			d							dd��Z
					d															dd�Zej	d			dd��Zy)r�a�The CLI runner provides functionality to invoke a Click command line
    script for unittesting purposes in a isolated environment.  This only
    works in single-threaded systems without any concurrency as it changes the
    global interpreter state.

    :param charset: the character set for the input and output data.
    :param env: a dictionary with environment variables for overriding.
    :param echo_stdin: if this is set to `True`, then reading from `<stdin>` writes
                       to `<stdout>`.  This is useful for showing examples in
                       some circumstances.  Note that regular prompts
                       will automatically echo the input.
    :param catch_exceptions: Whether to catch any exceptions other than
                             ``SystemExit`` when running :meth:`~CliRunner.invoke`.
    :param capture: Selects the output capture strategy. ``sys`` (default)
        captures Python-level writes only and leaves
        :meth:`sys.stdout.fileno` raising :exc:`io.UnsupportedOperation`, so
        user code that calls :func:`os.dup2` on ``sys.stdout.fileno()`` cannot
        clobber the host runner's stdout. ``fd`` redirects file descriptors
        ``1`` and ``2`` via :func:`os.dup2` to a temporary file, also catching
        output from stale stream references, C extensions, and subprocesses.
        ``fd`` is not supported on Windows.

    .. versionchanged:: 8.4.0
        Added the ``capture`` parameter. The default ``sys`` mode no longer
        exposes the original fd through :meth:`fileno`, reverting the change
        introduced in ``8.3.3`` that broke Pytest's ``fd``-level capture
        teardown. Use ``capture="fd"`` to restore that behavior with proper
        isolation. :issue:`3384`

    .. versionchanged:: 8.2
        Added the ``catch_exceptions`` parameter.

    .. versionchanged:: 8.2
        ``mix_stderr`` parameter has been removed.
    r@r��cabc.Mapping[str, str | None]�envr�
echo_stdin�catch_exceptionsr�captureNc���|dvrtd|�d���|dk(r"tjdk(rtd|�d���||_|xsi|_||_||_||_y)N>rrzcapture=z) is not valid. Choose from 'sys' or 'fd'.rr
z( is not supported on Windows. Use 'sys'.)�
ValueErrorr�platformr�r�r�r�r�)rr�r�r�r�r�s      rrzCliRunner.__init__hs~���-�'���7�+�%N�O��
��d�?�s�|�|�w�6���7�+�%M�N��
�����9�"���$��� 0�����rc�"�|jxsdS)z�Given a command object it will return the default program name
        for it.  The default is the `name` attribute or ``"root"`` if not
        set.
        �root)r�)r�clis  r�get_default_prog_namezCliRunner.get_default_prog_name~s��
�x�x�!�6�!rc�V�t|j�}|r|j|�|S)z8Returns the environment overrides for invoking a script.)�dictr��update)r�	overridesr(s   r�make_envzCliRunner.make_env�s%���$�(�(�^����I�I�i� ��	rc#�@	���K�t||j�}d}tj}tj}tj
}tj}	dt_|j|�}t�}
|jr:tjtjt||
j��x}}t||jdd��xt_�|jrd�_t|
j|jdd��t_t|
j
|jd	dd
��t_t#|�dd�fd�
�}t#|�dd�fd
�
�}t#|�dd��}
|�	d					d�fd�
}t$j&}t$j(}t$j*}t,j.}t0j.}t2j4j6�|t$_|t$_|
t$_|t,_|t0_			d											d�fd�
}|t2j4_i}	|j9�D]O\}}t:j<j?|�||<|�	t:j<|=�=|t:j<|<�Q|
j|
j
|
jBf��|j9�D]-\}}|�	t:j<|=�|t:j<|<�/|t_|t_|t_|t$_|t$_|t$_|t,_|t0_|	t_�t2j4_y#t@$rY��<wxYw#t@$rY��wxYw#|j9�D]<\}}|�"	t:j<|=�#t@$rY�&wxYw|t:j<|<�>|t_|t_|t_|t$_|t$_|t$_|t,_|t0_|	t_�t2j4_wxYw�w)a\A context manager that sets up the isolation for invoking of a
        command line tool.  This sets up `<stdin>` with the given input data
        and `os.environ` with the overrides from the given dictionary.
        This also rebinds some internals in Click to be mocked (like the
        prompt functionality).

        This is automatically done in the :meth:`invoke` method.

        :param input: the input stream to put into `sys.stdin`.
        :param env: the environment overrides as dictionary.
        :param color: whether the output should contain color codes. The
                      application can still override this explicitly.

        .. versionadded:: 8.2
            An additional output stream is returned, which is a mix of
            `<stdout>` and `<stderr>` streams.

        .. versionchanged:: 8.2
            Always returns the `<stderr>` stream.

        .. versionchanged:: 8.0
            `<stderr>` is opened with ``errors="backslashreplace"``
            instead of the default ``"strict"``.

        .. versionchanged:: 4.0
            Added the ``color`` parameter.
        N�Pz<stdin>�r)�encodingr�r�rz<stdout>�wz<stderr>�backslashreplace)r�r�r��errorsc�<��tjj|xsd�	t��j	d�}tjj|�d��tjj�|S#t
$r}t
�|�d}~wwxYw)N�r�r�)rrvr'�next�rstrip�
StopIteration�EOFErrorrn)�prompt�val�e�
text_inputs   �r�
visible_inputz*CliRunner.isolation.<locals>.visible_input�s~����J�J���V�\�r�*�
(��:�&�-�-�f�5��
�J�J����u�B�Z�(��J�J�����J��	!�
(��j�a�'��
(�s�B�	B�B�Bc����tjj|xsd�d��tjj�	t	��jd�S#t$r}t�|�d}~wwxYw)Nr�r�r�)rrvr'rnr�r�r�r�)r�r�r�s  �r�hidden_inputz)CliRunner.isolation.<locals>.hidden_input�se����J�J�����"�~�R�0�1��J�J����
(��J�'�.�.�v�6�6�� �
(��j�a�'��
(�s�A!�!	A:�*A5�5A:c���tjjd�}|rtjj	|�tjj�|S)Nr)r�stdinr+rvr'rn)�echo�chars  r�_getcharz%CliRunner.isolation.<locals>._getchar�s>���9�9�>�>�!�$�D���
�
� � ��&��J�J�����Krc���|��S|Sr!rJ)rL�color�
default_colors  �r�should_strip_ansiz.CliRunner.isolation.<locals>.should_strip_ansi�s����}�(�(�(��9�rc�h��|�tj}|�tj}�|f|||d�|��y)abDefault ``pdb.Pdb`` to real terminal streams during
            ``CliRunner`` isolation.

            Without this patch, ``pdb.Pdb.__init__`` inherits from
            ``cmd.Cmd`` which falls back to ``sys.stdin``/``sys.stdout``
            when no explicit streams are provided. During isolation
            those are ``BytesIO``-backed wrappers, so the debugger
            reads from an empty buffer and writes to captured output,
            making interactive debugging impossible.

            By defaulting to ``sys.__stdin__``/``sys.__stdout__`` (the
            original terminal streams Python preserves regardless of
            redirection), debuggers can interact with the user while
            ``click.echo`` output is still captured normally.

            This covers ``pdb.set_trace()``, ``breakpoint()``,
            ``pdb.post_mortem()``, and debuggers that subclass
            ``pdb.Pdb`` (ipdb, pdbpp). Explicit ``stdin``/``stdout``
            arguments are honored and not overridden. Debuggers that
            do not subclass ``pdb.Pdb`` (pudb, debugpy) are not
            covered.
            N)�completekeyr�rv)r�	__stdin__�
__stdout__)rr�r�rvr��old_pdb_inits     �r�_patched_pdb_initz.CliRunner.isolation.<locals>._patched_pdb_init
s@���:�}��
�
���~�������
�"-�U�6�
�MS�
rr!)r�z
str | Noner>r@)r�rr>r@)NN)rLzt.IO[t.Any] | Noner��bool | Noner>r)�tabNN)rzpdb.Pdbr�r@r��t.IO[str] | Nonervr�r�rAr>r?)"r�r�rr�rvrwr�FORCED_WIDTHr�rur�r�r��BinaryIOrr|�_CHUNK_SIZErMr�visible_prompt_func�hidden_prompt_funcr�r	r�r�pdb�Pdbr�itemsrX�environ�get�	Exceptionr)rrr�r��bytes_input�
echo_input�	old_stdin�
old_stdout�
old_stderr�old_forced_width�stream_mixerr�r�r�r��old_visible_prompt_func�old_hidden_prompt_func�old__getchar_func�old_should_strip_ansi�old__compat_should_strip_ansir��old_env�key�valuer�r�r�s                        @@@r�	isolationzCliRunner.isolation�s�����D(��t�|�|�<���
��I�I�	��Z�Z�
��Z�Z�
�%�2�2��"$�
���m�m�C� ��"�}���?�?�'(�v�v��
�
�L��l�6I�6I�J�(�
�K�*�"5��$�,�,�Y�S�"
�	
��	�J��?�?�&'�J�"�(�����\�\���	
��
�)�����\�\���%�
��
�
�Z�	 �	�
!�	�
�Z�	 �	(�
!�	(�
�Z�	 �	�
!�	��
�EI�	�&�	�6A�	�
�	�#)�"<�"<��!'�!:�!:��"�O�O�� %� 7� 7��(/�(A�(A�%��w�w�'�'��%2��"�$0��!�"���"3���$5��!� %�&*�'+�	#	��#	��#	�$�#	�%�	#	�
�#	��
#	�J-�������	,�!�i�i�k�
��U�!�z�z�~�~�c�2�����=���J�J�s�O�',�B�J�J�s�O�*� �&�&��(;�(;�\�=P�=P�Q�Q�%�m�m�o�
��U��=���J�J�s�O�',�B�J�J�s�O�.�$�C�J�#�C�J�!�C�I�)@�F�&�(>�F�%�/�F�O�&;�E�#�(E�G�%�&6�J�#�+�C�G�G���/%�����%�����	&�m�m�o�
��U��=���J�J�s�O��$�����',�B�J�J�s�O�.�$�C�J�#�C�J�!�C�I�)@�F�&�(>�F�%�/�F�O�&;�E�#�(E�G�%�&6�J�#�+�C�G�G��s��I-R�3:O�.N3�?;O�:R�O�$BR�3	O�<O�?O�O�	O�R�O�R�R�,O>�=R�>	P
	�R�	P
	�
BR�Rc
��d}|�|j}d}	d}
|jdk(r7td�}	td�}
	|	j�|
j�|j|||��5}|	�@|
�>|	jtj_	|
jtj_	d}d}
d}t|t�rtj|�}	|jd�}	|j$d|xsd|d	�|��}tjj7�tjj7�|	�N|
�L|	j9�}|
j9�}|r|dj3|�|r|dj3|�|dj;�}|dj;�}|dj;�}	ddd�t=|
|��S#t$rdx}	}
Y���wxYw#t $r|j#|�}Y��,wxYw#t&$r�}tj(�}t+j,d
|j.�}|�d}|dk7r|}
t|t0�sItjj3t|��tjj3d�d}|}Yd}~���d}~wt4$r&}|s�|}
d}tj(�}Yd}~���d}~wwxYw#tjj7�tjj7�|	�N|
�L|	j9�}|
j9�}|r|dj3|�|r|dj3|�|dj;�}|dj;�}|dj;�}wxYw#1swY���xYw)
a{Invokes a command in an isolated environment.  The arguments are
        forwarded directly to the command line script, the `extra` keyword
        arguments are passed to the :meth:`~clickpkg.Command.main` function of
        the command.

        This returns a :class:`Result` object.

        :param cli: the command to invoke
        :param args: the arguments to invoke. It may be given as an iterable
                     or a string. When given as string it will be interpreted
                     as a Unix shell command. More details at
                     :func:`shlex.split`.
        :param input: the input data for `sys.stdin`.
        :param env: the environment overrides.
        :param catch_exceptions: Whether to catch any other exceptions than
                                 ``SystemExit``. If :data:`None`, the value
                                 from :class:`CliRunner` is used.
        :param extra: the keyword arguments to pass to :meth:`main`.
        :param color: whether the output should contain color codes. The
                      application can still override this explicitly.

        .. versionadded:: 8.2
            The result object has the ``output_bytes`` attribute with
            the mix of ``stdout_bytes`` and ``stderr_bytes``, as the user would
            see it in its terminal.

        .. versionchanged:: 8.2
            The result object always returns the ``stderr_bytes`` stream.

        .. versionchanged:: 8.0
            The result object has the ``return_value`` attribute with
            the value returned from the invoked command.

        .. versionchanged:: 4.0
            Added the ``color`` parameter.

        .. versionchanged:: 3.0
            Added the ``catch_exceptions`` parameter.

        .. versionchanged:: 3.0
            The result object has the ``exc_info`` attribute with the
            traceback if available.
        Nrr�)rr�r�r�	prog_namerJ)�argsrzint | t.Any | Noner�r�)r�r�rOr^�OSErrorrrQrrvrrwr�r@�shlex�split�pop�KeyErrorr��main�
SystemExitr�r�r��coderDr'r�rnrc�getvaluer�)rr�rrr�r�r��extrar��cap_out�cap_err�
outstreamsr�r�r�rr��e_code�fd_out�fd_errrvrwrs                       r�invokezCliRunner.invokeTsh��j���#�#�4�4��&*��%)���<�<�4�� ��m�G� ��m�G�
)��
�
���
�
���^�^�%�S��^�
>�*��"�w�':�*1�*:�*:��
�
�'�*1�*:�*:��
�
�'��L�.2�I��I��$��$��{�{�4�(��
<�!�I�I�k�2�	�*
2�'�s�x�x�V�T�Z�R�9�V�PU�V��2�
�
� � �"��
�
� � �"�
�&�7�+>�$�\�\�^�F�$�\�\�^�F��"�1�
�+�+�F�3��"�1�
�+�+�F�3�#�A��/�/�1��#�A��/�/�1��#�A��/�/�1��}?�@�����%����	
�		
��G�
)�$(�(��'�
)��(�
<� �6�6�s�;�	�
<��
�
#��<�<�>����� 4�a�f�f�=���>��F��Q�;� !�I�!�&�#�.��J�J�$�$�S��[�1��J�J�$�$�T�*��F�"�	���
*�'���	��	��<�<�>���
*���
�
� � �"��
�
� � �"�
�&�7�+>�$�\�\�^�F�$�\�\�^�F��"�1�
�+�+�F�3��"�1�
�+�+�F�3�#�A��/�/�1��#�A��/�/�1��#�A��/�/�1���}?�
>�s�� G*�/A.O�G>�0H�	CO�*
G;�:G;�>H�O�H�O�	K:�(BK�K=�K:�K5�/K=�5K:�:K=�=CO�O�Oc#�K�tj�}tj|��}tj|�	|��tj|�|�ddl}	|j
|�yy#t$rYywxYw#tj|�|�&ddl}	|j
|�w#t$rYwwxYwwxYw�w)a�A context manager that creates a temporary directory and
        changes the current working directory to it. This isolates tests
        that affect the contents of the CWD to prevent them from
        interfering with each other.

        :param temp_dir: Create the temporary directory under this
            directory. If given, the created directory is not removed
            when exiting.

        .. versionchanged:: 8.0
            Added the ``temp_dir`` parameter.
        )�dirNr)rX�getcwdrZ�mkdtemp�chdir�shutil�rmtreer)r�temp_dir�cwd�dtrs     r�isolated_filesystemzCliRunner.isolated_filesystem�s����� �i�i�k��
�
�
�(�
+��
�����	��H��H�H�S�M������M�M�"�%�	 ��
�����
�H�H�S�M������M�M�"�%������� �sf�AC�B�C�#A6�4C�6	B�?C�B�C�C�"B4�3C�4	C�=C�?C�C�C)zutf-8NFTr)r�r@r��$cabc.Mapping[str, str | None] | Noner�rr�rr�rr>r?)r�rr>r@r!)r�r$r>r�)NNF)r� str | bytes | t.IO[t.Any] | Noner�r$r�rr>z9cabc.Generator[tuple[io.BytesIO, io.BytesIO, io.BytesIO]])NNNNF)r�rrzstr | cabc.Sequence[str] | Nonerr%r�r$r�r�r�rrrAr>r�)r zstr | os.PathLike[str] | Noner>zcabc.Generator[str])
rFrGrHrerIrr�r��
contextlib�contextmanagerrrr#rJrrr�r�=s���"�H�L�	&�&�����
���48� �!%�$�
���2���	�
���
�
��,"�AE��=��	&�����37�48��	C,�/�C,�2�C,��	C,�

C�C,��C,�P15�26�48�(,��O
�
�O
�.�O
�0�	O
�
2�O
�&�
O
��O
��O
�
�O
�b���8<��5��	���rr�)rLzEchoingStdin | Noner>zcabc.Generator[None])rr%r�r@r>r)/�
__future__r�collections.abc�abc�cabcr&ryrXr�r	rrZ�typingr��typesrr�rrrr	r
�
TYPE_CHECKING�	_typeshedr�corerr��LiteralrrI�tupler��
BaseExceptionrrr'rMrOrzrgru�
TextIOWrapperr|r�r�r�rJrr�<module>r5s"��"���	�	�
��
��������(��?�?�(���<�<�7�� �y�y��/�K��/� �y�y��5�K��5�"�4�
�#6�
�}�#T�U�
�{�U�#!�#!�L������"�"�J �"�*�*� �*7�7�$4�"�*�*�4�n�+��69����(S4�S4�lG�Gr