+
     Hi  c                   s    R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt ^ RIH	t	H
t
 ^RIHtHt ^RIHt ^RIHt  ! R R]4      tR#   ] d    ^ RI	H	t	H
t
  L2i ; i)zJProvides an interface like pexpect.spawn interface using subprocess.Popen
N)QueueEmpty)	SpawnBasePY3)EOF)string_typesc                   st   a a ] tR t^t oRV 3R lltRtR tR tR tR t	R t
RR ltR	 tR
 tR tRtVtV ;t# )
PopenSpawnc           
     s"  < \         \        V `  W#WEWR 7       Vf&   \        P                  P                  R4      V n        M$V P                  \        P                  4      V n        \        ^ \        P                  \        P                  \        P                  WjVR7      p\        P                  R8X  dT   \        P                  ! 4       pV;P                  \        P                   ,          un        WR&   \        P"                  VR&   \%        V\&        4      '       d?   \        P                  R8w  d*   \(        P*                  ! V\        P,                  R8H  R7      p\        P.                  ! V3/ VB V n        V P0                  P2                  V n        R	V n        V P                  4       V n        \9        4       V n        \<        P>                  ! V P@                  R
7      V n!        RV PB                  n"        V PB                  PG                  4        R# ))timeoutmaxreadsearchwindowsizelogfileencodingcodec_errorsNZascii)ZbufsizestdinZstderrstdoutcwd
preexec_fnenvwin32startupinfoZcreationflagsposix)r   F)ZtargetT)$Zsuperr   __init__oslinesepencodecrlfZstring_typeZdict
subprocessZPIPEZSTDOUTsysplatformZSTARTUPINFOZdwFlagsZSTARTF_USESHOWWINDOWZCREATE_NEW_PROCESS_GROUPZ
isinstancer   shlexZsplitZnameZPopenprocpidclosed_bufr    _read_queue	threadingZThread_read_incoming_read_threadZdaemonZstart)selfZcmdr   r   r	   r
   r   r   r   r   r   Zkwargsr   	__class__s   &&&&&&&&&&&  8/usr/lib/python3.14/site-packages/pexpect/popen_spawn.pyr   ZPopenSpawn.__init__   sw    	j$(!1! 	) 	> 

))73DI(("**5DIaz'..z#? <<7"$002K:#B#BB$/=!&0&I&IF?#c<((S\\W-D++cG);<C$$S3F3	99==$$&	 7%,,D4G4GH#' !    Fc                s^   V P                   pV P                  '       d)   V'       d   W1R  V n         VR V # RV n        \        R4      hVR8X  d   V P                  pMVf   Rp\
        P
                  ! 4       p\
        P
                  ! 4       V,
          V8  de   V'       d]   \        V4      V8  dM    V P                  P                  4       pVf	   RV n        M%W0P                  P                  VRR7      ,          pK  VR V W1R  uq`n         V P                  VR4       V#   \         d     K0  i ; i)NTzEnd Of File (EOF).g    .AFZfinalreadi)r!   _read_reached_eofflag_eofr   r   timelenr"   Z
get_nowaitZ_decoderZdecoder   _log)r&   Zsizer   bufZt0ZincomingZrs   &&&    r(   read_nonblockingZPopenSpawn.read_nonblockingA   s   ii!!! J	5Dz! $.//b=llG_GYY[yy{R7*tC4	C++668 #-1D*}}++HE+BB5Dz3u:9		!V  s   0D D,+D,c                sX   V P                   P                  P                  4       p Rp \        P                  ! VR4      pV'       g   V P                  P                  R4       R# V P                  P                  V4       K]    \
         d   pT P                  TR4        Rp?LdRp?ii ; i)z6Run in a thread to move output from a pipe to a queue.r)   i   r+   N)	r   r   filenor   r+   ZOSErrorr0   r"   Zput)r&   r3   r1   Zes   &   r(   r$   ZPopenSpawn._read_incomingd   s    !!((*C%ggfd+   $$T*  %  %		!V$$%s   B B)B$$B)c                s(    V P                  V4       R# )zHThis is similar to send() except that there is no return value.
        Nsend)r&   s   &&r(   writeZPopenSpawn.writeu   s     			!r)   c                s:    V F  pV P                  V4       K  	  R# )zThis calls write() for each element in the sequence.

The sequence can be any iterable object producing strings, typically a
list of strings. This does not add line separators. There is no return
value.
Nr4   )r&   Zsequencer6      && r(   
writelinesZPopenSpawn.writelinesz   s     AIIaL r)   c                sD   V P                  V4      pV P                  VR4       V P                  P                  VRR7      p\        '       d&   V P
                  P                  P                  V4      # V P
                  P                  P                  V4       \        V4      # )zJSend data to the subprocess' stdin.

Returns the number of bytes written.
r5   Fr*   )	Z_coerce_send_stringr0   Z_encoderr   r   r   r   r8   r/   )r&   r6   Zbr9   r(   r5   ZPopenSpawn.send   sz    
 $$Q'		!VMM  % 0399??((++ IIOO!!!$q6Mr)   c                sf    V P                  V4      pW P                  V P                  4      ,           # )z~Wraps send(), sending string ``s`` to child process, with os.linesep
automatically appended. Returns number of bytes written. )r5   r   )r&   r6   Znr9   r(   sendlineZPopenSpawn.sendline   s'     IIaL99T\\***r)   c                s    V P                   P                  4       pV^ 8  d   Wn        RV n        MRV n        V) V n        RV n        V# )z;Wait for the subprocess to finish.

Returns the exit code.
NT)r   wait
exitstatussignalstatus
terminated)r&   Zstatuss   & r(   r<   ZPopenSpawn.wait   sE    
 !Q;$O $D"DO!'Dr)   c                s~   \         P                  R8X  d}   V\        P                  \        P                  39   d   \        P                  pMFV\        P
                  \        P                  39   d   \        P                  pM\        P                  p\        P                  ! V P                  P                  V4       R# )zmSends a Unix signal to the subprocess.

Use constants from the :mod:`signal` module to specify which signal.
r   N)r   r   signalZSIGINTZCTRL_C_EVENTZSIGBREAKZCTRL_BREAK_EVENTZSIGTERMr   killr   r   )r&   Zsigr7   r(   rA   ZPopenSpawn.kill   ss    
 <<7"v}}f&9&9::))&*A*ABB--nn
		s#r)   c                sN    V P                   P                  P                  4        R# )z+Closes the stdin pipe from the writing end.N)r   r   Zclose)r&   s   &r(   sendeofZPopenSpawn.sendeof   s    		r)   )r!   r"   r,   r%   r    r   r=   r-   r   r   r>   r?   )	i   i  NNNNNZstrictN)Z )Z__name__Z
__module__Z__qualname__Z__firstlineno__r   r,   r2   r$   r8   r:   r5   r;   r<   rA   rB   Z__static_attributes__Z__classdictcell__Z__classcell__)r'   Z__classdict__s   @@r(   r   r      sF     ("T !F&"
"+$   r)   r   )Z__doc__r   r#   r   r   r.   r@   r   Zqueuer    r   ZImportErrorZ	spawnbaser   r   Z
exceptionsr   Zutilsr   r   ) r)   r(   <module>rC      sW    	   
   #" &  h  h   #""#s   A	 	AA