
    jud                       S SK Jr  S SKJr  S SKrS SKrS SKrS SKrS SK	r	S SK
r
S SKrS SKrS SKJr  SSKJr  SSKJr  SSKJr  SSKJr  SS	KJr  \R,                  (       a  S S
KJr  SSKJr  \R6                  S   r " S S5      r\R<                  SS j5       r " S S5      r  " S S\RB                  5      r" " S S5      r# " S S\RH                  5      r%      SS jr& " S S5      r' " S S5      r(g)    )annotationsN)TracebackType   )_compat)
formatting)termui)utils)_find_binary_reader)ReadableBuffer)Command)sysfdc                  z    \ rS rSrSS jrSS jrSS jrSSS jjrSSS jjrSSS jjr	SS jr
SS	 jrSS
 jrSrg)EchoingStdin   c                *    Xl         X l        SU l        g )NF_input_output_paused)selfinputoutputs      J/var/www/reloj-farallon/venv/lib/python3.13/site-packages/click/testing.py__init__EchoingStdin.__init__   s        c                .    [        U R                  U5      $ N)getattrr   r   xs     r   __getattr__EchoingStdin.__getattr__"   s    t{{A&&r   c                ^    U R                   (       d  U R                  R                  U5        U$ r   )r   r   write)r   rvs     r   _echoEchoingStdin._echo%   s     ||LLr"	r   c                V    U R                  U R                  R                  U5      5      $ r   )r(   r   readr   ns     r   r+   EchoingStdin.read+   s     zz$++**1-..r   c                V    U R                  U R                  R                  U5      5      $ r   )r(   r   read1r,   s     r   r0   EchoingStdin.read1.   s     zz$++++A.//r   c                V    U R                  U R                  R                  U5      5      $ r   )r(   r   readliner,   s     r   r3   EchoingStdin.readline1   s     zz$++..q122r   c                ~    U R                   R                  5        Vs/ s H  oR                  U5      PM     sn$ s  snf r   )r   	readlinesr(   r!   s     r   r6   EchoingStdin.readlines4   s/    '+{{'<'<'>?'>!

1'>???s   :c                B   ^  [        U 4S jT R                   5       5      $ )Nc              3  F   >#    U  H  nTR                  U5      v   M     g 7fr   )r(   ).0r"   r   s     r   	<genexpr>(EchoingStdin.__iter__.<locals>.<genexpr>8   s     7;aDJJqMM;s   !)iterr   r   s   `r   __iter__EchoingStdin.__iter__7   s    74;;777r   c                ,    [        U R                  5      $ r   )reprr   r>   s    r   __repr__EchoingStdin.__repr__:   s    DKK  r   r   N)r   
t.BinaryIOr   rE   returnNone)r"   strrF   t.Any)r'   bytesrF   rJ   ))r-   intrF   rJ   )rF   zlist[bytes])rF   zcabc.Iterator[bytes]rF   rH   )__name__
__module____qualname____firstlineno__r   r#   r(   r+   r0   r3   r6   r?   rC   __static_attributes__ r   r   r   r      s0    
'/03@8!r   r   c              #  @   #    U c  S v   g SU l         S v   SU l         g 7f)NTF)r   )streams    r   _pause_echorV   >   s     ~s   c                  6    \ rS rSrSrSS jrS	S jrS
S jrSrg)
_FDCaptureH   a>  Redirect 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
c                ,    Xl         SU l        S U l        g NrK   )	_targetfdsaved_fd_tmpfile)r   targetfds     r   r   _FDCapture.__init__S   s    !+/r   c                    [         R                  " U R                  5      U l        [        R
                  " SS9U l        [         R                  " U R                  R                  5       U R                  5        g )Nr   )	buffering)	osdupr\   r]   tempfileTemporaryFiler^   dup2filenor>   s    r   start_FDCapture.startX   sG    t~~. ..;
$$&7r   c                ~   U R                   c   S5       e[        R                  " U R                  U R                  5        [        R
                  " U R                  5        SU l        U R                   R                  S5        U R                   R                  5       nU R                   R                  5         S U l         U$ )Nz!_FDCapture.start() was not calledrK   r   )r^   rc   rg   r]   r\   closeseekr+   )r   datas     r   stop_FDCapture.stop]   s    }}(M*MM(
t~~.
1}}!!#r   )r\   r^   r]   N)r_   rL   rF   rG   rF   rG   )rF   rJ   )	rN   rO   rP   rQ   __doc__r   ri   ro   rR   rS   r   r   rX   rX   H   s    0
8
	r   rX   c                  P   ^  \ rS rSrSrSU 4S jjrSU 4S jjrS	U 4S jjrSrU =r	$ )
BytesIOCopyi   z\Patch ``io.BytesIO`` to let the written stream be copied to another.

.. versionadded:: 8.2
c                .   > [         TU ]  5         Xl        g r   )superr   copy_to)r   rx   	__class__s     r   r   BytesIOCopy.__init__o   s    r   c                V   > [         TU ]  5         U R                  R                  5         g r   )rw   flushrx   r   ry   s    r   r|   BytesIOCopy.flushs   s    r   c                X   > U R                   R                  U5        [        TU ]  U5      $ r   )rx   r&   rw   )r   bry   s     r   r&   BytesIOCopy.writew   s$    1w}Qr   rx   )rx   z
io.BytesIOrF   rG   rq   )r   r   rF   rL   )
rN   rO   rP   rQ   rr   r   r|   r&   rR   __classcell__ry   s   @r   rt   rt   i   s    
   r   rt   c                  "    \ rS rSrSrSS jrSrg)StreamMixer|   zvMixes `<stdout>` and `<stderr>` streams.

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

.. versionadded:: 8.2
c                    [         R                  " 5       U l        [        U R                  S9U l        [        U R                  S9U l        g )Nr   )ioBytesIOr   rt   stdoutstderrr>   s    r   r   StreamMixer.__init__   s/    "$**,"-dkk"B"-dkk"Br   )r   r   r   Nrq   )rN   rO   rP   rQ   rr   r   rR   rS   r   r   r   r   |   s    Cr   r   c                     ^  \ rS rSrSr          S	U 4S jjrS
S jrSU 4S jjr\SS j5       r	\SS j5       r
SrU =r$ )_NamedTextIOWrapper   a  A :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.
c                N   > [         TU ]  " U40 UD6  X l        X0l        SU l        g r[   )rw   r   _name_mode_original_fd)r   buffernamemodekwargsry   s        r   r   _NamedTextIOWrapper.__init__   s)     	*6*

!#r   c                    g)zThe buffer this object contains belongs to some other object,
so prevent the default ``__del__`` implementation from closing
that buffer.

.. versionadded:: 8.3.2
NrS   r>   s    r   rl   _NamedTextIOWrapper.close   s    r   c                X   > U R                   S:  a  U R                   $ [        TU ]	  5       $ )zReturn 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   )r   rw   rh   r}   s    r   rh   _NamedTextIOWrapper.fileno   s,     !$$$w~r   c                    U R                   $ r   )r   r>   s    r   r   _NamedTextIOWrapper.name       zzr   c                    U R                   $ r   )r   r>   s    r   r   _NamedTextIOWrapper.mode   r   r   )r   r   r   )
r   rE   r   rH   r   rH   r   rI   rF   rG   rq   )rF   rL   rM   )rN   rO   rP   rQ   rr   r   rl   rh   propertyr   r   rR   r   r   s   @r   r   r      so    	
$
$ 
$ 	
$
 
$ 

$     r   r   c                   [        U S5      (       a0  [        [        R                  " SU 5      5      nUb  U$ [	        S5      eU c  Sn O&[        U [        5      (       a  U R                  U5      n [        R                  " U 5      $ )Nr+   zt.IO[t.Any]z.Could not find binary reader for input stream.r   )
hasattrr
   tcast	TypeError
isinstancerH   encoder   r   )r   charsetr'   s      r   make_input_streamr      sp     uf u!=>>IHII}	E3		W%::er   c                      \ rS rSrSr S
               SS jjr\SS j5       r\SS j5       r\SS j5       r	SS jr
S	rg)Result   a  Holds 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``.
Nc	                d    Xl         X l        X0l        X@l        XPl        X`l        Xpl        Xl        g r   runnerstdout_bytesstderr_bytesoutput_bytesreturn_value	exit_code	exceptionexc_info)	r   r   r   r   r   r   r   r   r   s	            r   r   Result.__init__   s0     (((("" r   c                    U R                   R                  U R                  R                  S5      R	                  SS5      $ )zThe 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   r>   s    r   r   Result.output   s9       ''(;(;YGOOD
 	
r   c                    U R                   R                  U R                  R                  S5      R	                  SS5      $ )z&The standard output as unicode string.r   r   r   )r   r   r   r   r   r>   s    r   r   Result.stdout  s9       ''(;(;YGOOD
 	
r   c                    U R                   R                  U R                  R                  S5      R	                  SS5      $ )zThe 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   r>   s    r   r   Result.stderr  s9       ''(;(;YGOOD
 	
r   c                    U R                   (       a  [        U R                   5      OSnS[        U 5      R                   SU S3$ )Nokay< >)r   rB   typerN   )r   exc_strs     r   rC   Result.__repr__  s8    *...$t~~&f4:&&'q	33r   )r   r   r   r   r   r   r   r   r   )r   	CliRunnerr   rJ   r   rJ   r   rJ   r   rI   r   rL   r   zBaseException | Noner   z?tuple[type[BaseException], BaseException, TracebackType] | NonerM   )rN   rO   rP   rQ   rr   r   r   r   r   r   rC   rR   rS   r   r   r   r      s    > !! ! 	!
 ! ! ! (!!* 	
 	
 
 
 
 
4r   r   c                     \ rS rSrSr     S           SS jjrSS jr S   SS jjr\R                     S       SS jj5       r
     S               SS jjr\R                   S   SS	 jj5       rS
rg)r   i  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.
Nc                    US;  a  [        SU< S35      eUS:X  a$  [        R                  S:X  a  [        SU< S35      eXl        U=(       d    0 U l        X0l        X@l        XPl        g )N>   r   r   zcapture=z) is not valid. Choose from 'sys' or 'fd'.r   win32z( is not supported on Windows. Use 'sys'.)
ValueErrorr   platformr   env
echo_stdincatch_exceptionscapture)r   r   r   r   r   r   s         r   r   CliRunner.__init__D  sv     -'7+%NO  d?s||w67+%MN  25)$ 0$+r   c                ,    UR                   =(       d    S$ )zGiven 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_nameCliRunner.get_default_prog_nameZ  s    
 xx!6!r   c                `    [        U R                  5      nU(       a  UR                  U5        U$ )z8Returns the environment overrides for invoking a script.)dictr   update)r   	overridesr'   s      r   make_envCliRunner.make_enva  s%     $((^IIi 	r   c              #  z	  ^^^#    [        XR                  5      nSn[        R                  n[        R                  n[        R
                  n[        R                  n	S[        l        U R                  U5      n[        5       n
U R                  (       a9  [        R                  " [        R                  [        XJR                  5      5      =pE[        X@R                  SSS9=[        l        mU R                  (       a  STl        [        U
R                  U R                  SSS9[        l        [        U
R
                  U R                  S	SS
S9[        l        [#        U5      SSU4S jjj5       n[#        U5      SSU4S jjj5       n[#        U5      SS j5       nUm S     SU4S jjjn[$        R&                  n[$        R(                  n[$        R*                  n[,        R.                  n[0        R.                  n[2        R4                  R6                  mU[$        l        U[$        l        U[$        l        U[,        l        U[0        l           S           SU4S jjjnU[2        R4                  l        0 n UR9                  5        HR  u  nn[:        R<                  R?                  U5      UU'   Uc   [:        R<                  U	 M?  U[:        R<                  U'   MT     U
R                  U
R
                  U
RB                  4v   UR9                  5        H0  u  nnUc   [:        R<                  U	 M  U[:        R<                  U'   M2     U[        l        U[        l        U[        l        U[$        l        U[$        l        U[$        l        U[,        l        U[0        l        U	[        l        T[2        R4                  l        g! [@         a     GMF  f = f! [@         a     M  f = f! UR9                  5        HA  u  nnUc%   [:        R<                  U	 M  ! [@         a     M*  f = fU[:        R<                  U'   MC     U[        l        U[        l        U[        l        U[$        l        U[$        l        U[$        l        U[,        l        U[0        l        U	[        l        T[2        R4                  l        f = f7f)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.
NP   z<stdin>r)encodingr   r   r   z<stdout>wz<stderr>backslashreplace)r   r   r   errorsc                H  > [         R                  R                  U =(       d    S5         [        T5      R	                  S5      n[         R                  R                  U S35        [         R                  R                  5         U$ ! [
         a  n[        5       UeS nAff = f)N r   r   )r   r   r&   nextrstripStopIterationEOFErrorr|   )promptvale
text_inputs      r   visible_input*CliRunner.isolation.<locals>.visible_input  s~    JJV\r*(:&--f5 JJuBZ(JJJ	 ! (ja'(s   B 
B!BB!c                  > [         R                  R                  U =(       d    S S35        [         R                  R                  5          [	        T5      R                  S5      $ ! [         a  n[        5       UeS nAff = f)Nr   r   r   )r   r   r&   r|   r   r   r   r   )r   r   r   s     r   hidden_input)CliRunner.isolation.<locals>.hidden_input  se    JJ"~R01JJ(J'..v66  (ja'(s   A& &
B 0A;;B c                    [         R                  R                  S5      nU (       a  [         R                  R	                  U5        [         R                  R                  5         U$ )Nr   )r   stdinr+   r   r&   r|   )echochars     r   _getchar%CliRunner.isolation.<locals>._getchar  s>    99>>!$D

  &JJKr   c                &   > Uc  T(       + $ U(       + $ r   rS   )rU   colordefault_colors     r   should_strip_ansi.CliRunner.isolation.<locals>.should_strip_ansi  s     }(((9r   c                j   > Uc  [         R                  nUc  [         R                  nT" U 4XUS.UD6  g)a  Default ``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   r   )r   	__stdin__
__stdout__)r   r  r   r   r   old_pdb_inits        r   _patched_pdb_init.CliRunner.isolation.<locals>._patched_pdb_init  s>    : }~"-6MSr   r   )r   z
str | NonerF   rH   )r   boolrF   rH   )NN)rU   zt.IO[t.Any] | Noner   bool | NonerF   r  )tabNN)r   zpdb.Pdbr  rH   r   t.IO[str] | Noner   r  r   rI   rF   rG   )"r   r   r   r   r   r   r   FORCED_WIDTHr   r   r   r   r   BinaryIOr   r   _CHUNK_SIZErV   r   visible_prompt_funchidden_prompt_funcr   r	   r  r   pdbPdbr   itemsrc   environget	Exceptionr   )r   r   r   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   	isolationCliRunner.isolationj  s%    D (||<
II	ZZ
ZZ
%22"$
mmC "}??'(vv

L6I6IJ( K "5,,YS"
 	
	J ?? &'J"(\\	

 )\\%

 
Z	 	 	 
!	 
Z	 	( 	( 
!	( 
Z	 	 
!	  EI	&	6A		 	 #)"<"<!'!:!:"OO % 7 7(/(A(A%ww''%2"$0!""3$5!  %&*'+	#	#	#	 $#	 %	#	
 #	 #	 #	J -	,!iik
U!zz~~c2=JJsO ',BJJsO *  &&(;(;\=P=PQQ%mmo
U=JJsO ',BJJsO . $CJ#CJ!CI)@F&(>F%/FO&;E#(EG%&6J#+CGG/ %  % 	 &mmo
U=JJsO$  ',BJJsO . $CJ#CJ!CI)@F&(>F%/FO&;E#(EG%&6J#+CGGs   I8R;>;O) :O>O) 	R;#O4BR;
OO) OO) 
O&"R;%O&&R;)R8PR8
P%	!R8$P%	%BR88R;c                   SnUc  U R                   nSn	Sn
U R                  S:X  a7  [        S5      n	[        S5      n
 U	R                  5         U
R                  5         U R                  X4US9 nU	bA  U
b>  U	R                  [        R                  l	        U
R                  [        R                  l	        SnSnSn[        U[        5      (       a  [        R                  " U5      n UR                  S5      n UR$                  " SU=(       d    SUS	.UD6n[        R                  R7                  5         [        R                  R7                  5         U	bY  U
bV  U	R9                  5       nU
R9                  5       nU(       a  US   R3                  U5        U(       a  US   R3                  U5        US   R;                  5       nUS   R;                  5       nUS   R;                  5       n SSS5        [=        U WWWWWWUS9$ ! [         a    S=p GNf = f! [          a    U R#                  U5      n GN;f = f! [&         a  n[        R(                  " 5       n[*        R,                  " S
UR.                  5      nUc  SnUS:w  a  Un[        U[0        5      (       dI  [        R                  R3                  [        U5      5        [        R                  R3                  S5        SnUn SnAGNSnAf[4         a,  nU(       d  e UnSn[        R(                  " 5       n SnAGNSnAff = f! [        R                  R7                  5         [        R                  R7                  5         U	bY  U
bV  U	R9                  5       nU
R9                  5       nU(       a  US   R3                  U5        U(       a  US   R3                  U5        US   R;                  5       nUS   R;                  5       nUS   R;                  5       nf = f! , (       d  f       GN= f)ak  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.
Nr   r      )r   r   r   r   	prog_namerS   )argsr-  zint | t.Any | Noner   r   )r   r   rX   ri   OSErrorr)  r]   r   r   r   r   r   rH   shlexsplitpopKeyErrorr   main
SystemExitr   r   r   coderL   r&   r  r|   ro   getvaluer   )r   r   r.  r   r   r   r   extrar   cap_outcap_err
outstreamsr   r   r   r-  r   e_codefd_outfd_errr   r   r   s                          r   invokeCliRunner.invoke0  sj   j ##44 &*%)<<4 mG mG) ^^%^>* "w':*1*:*:

'*1*:*:

'L.2II$$${{4(<!IIk2	*2"xxVTZR9VPUV2 

  "

  "
 &7+>$\\^F$\\^F"1++F3"1++F3#A//1#A//1#A//1} ?@ %	
 		
G  )$((')(  < 66s;	<
  #<<> 4aff=>FQ; !I!&#..JJ$$S[1JJ$$T*F"	 *'		<<>* 

  "

  "
 &7+>$\\^F$\\^F"1++F3"1++F3#A//1#A//1#A//1} ?>s    G> -A6O9$H6H4CO9>HHH1-O90H11O94
L >B#K'!L#'L 4!LL#L  L##CO66O99
Pc              #    #    [         R                  " 5       n[        R                  " US9n[         R                  " U5         Uv   [         R                  " U5        Uc  SSKn UR                  U5        gg! [         a     gf = f! [         R                  " U5        Uc'  SSKn UR                  U5        f ! [         a     f f = ff = f7f)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   )rc   getcwdre   mkdtempchdirshutilrmtreer/  )r   temp_dircwddtrF  s        r   isolated_filesystemCliRunner.isolated_filesystem  s       iik(+
	HHHSMMM"%	  
   HHSMMM"%   sf   A CB C%A8 6C8
BCBCC
'B98C
9
CC
CC

C)r   r   r   r   r   )zutf-8NFTr   )r   rH   r   $cabc.Mapping[str, str | None] | Noner   r  r   r  r   CaptureModerF   rG   )r   r   rF   rH   r   )r   rM  rF   zcabc.Mapping[str, str | None])NNF)r    str | bytes | t.IO[t.Any] | Noner   rM  r   r  rF   z8cabc.Iterator[tuple[io.BytesIO, io.BytesIO, io.BytesIO]])NNNNF)r   r   r.  zstr | cabc.Sequence[str] | Noner   rO  r   rM  r   r  r   r  r8  rI   rF   r   )rH  zstr | os.PathLike[str] | NonerF   zcabc.Iterator[str])rN   rO   rP   rQ   rr   r   r   r   
contextlibcontextmanagerr)  r?  rK  rR   rS   r   r   r   r     sg   "L 48 !%$,, 2, 	,
 , , 
,," AE=	&  3748	C,/C, 2C, 	C,
 
BC, C,P 152648(,O
O
 .O
 0	O

 2O
 &O
 O
 O
 
O
b 8<5	 r   r   )rU   zEchoingStdin | NonerF   zcabc.Iterator[None])r   rO  r   rH   rF   rE   ))
__future__r   collections.abcabccabcrP  r   rc   r  r0  r   re   typingr   typesr   r   r   r   r   r	   r
   TYPE_CHECKING	_typeshedr   corer   LiteralrN  r   rQ  rV   rX   r   rt   r   TextIOWrapperr   r   r   r   rS   r   r   <module>r]     s    "   	 	 
  
        (??(ii$! !D   B "**  &C C0"** 0f+69(K4 K4\A Ar   