+
     Hi  c                   s    ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt ] ]P                  ^ ,          ^8  d   ]
3tM]]
3tR tRR ltR tRR ltRR ltR#   ] d    ]P                  t LLi ; i)i    Nc                s*   \         P                  P                  V 4      p\         P                  P                  V4      '       g   R# \         P                  ! V4      P
                  p\        P                  P                  R4      '       de   \         P                  ! 4       ^ 8X  dK   \        V\        P                  \        P                  ,          \        P                  ,          ,          4      # \         P                  ! V\         P                  4      # )zChecks that path is an executable regular file, or a symlink towards one.

This is roughly ``os.path isfile(path) and os.access(path, os.X_OK)``.
FZsunos)ospathZrealpathZisfilestatZst_modesysZplatformZ
startswithZgetuidZboolZS_IXUSRZS_IXGRPZS_IXOTHZaccessZX_OK)r   ZfpathZmodes   &  2/usr/lib/python3.14/site-packages/pexpect/utils.pyis_executable_filer      s     GGT"E77>>%  775>!!D((		q  DDLL LL) LL) * + 	+ 99UBGG$$    c                s   \         P                  P                  V 4      R8w  d   \        V 4      '       d   V # Vf   \         P                  pVP                  R4      pV'       g   \         P                  pVP                  \         P                  4      pV F7  p\         P                  P                  W@4      p\        V4      '       g   K5  Vu # 	  R# )zThis takes a given filename; tries to find it in the environment path;
then checks if it is executable. This returns the full path to the filename
if found and executable. Otherwise this returns None. NZPATH)
r    r   Zdirnamer   ZenvironZgetZdefpathZsplitZpathsepZjoin)ZfilenameZenvZpZpathlistr   Zffs   &&    r   whichr   0   s     
wwx B&+=h+G+G
{jjAJJwwrzz"HWW\\$)b!!I  r   c                s   . pRp^ p^p^p^p^pTpV  F  p	W8X  g   W8X  dc   V	R8X  d   TpK  V	R8X  d   TpK%  V	R8X  d   TpK0  V	P                  4       '       d    W8X  d   KN  VP                  V4       RpTpKe  W),           pTpKq  W8X  d   W),           pTpK  W8X  d   V	R8X  d   TpK  W),           pK  W8X  g   K  V	R8X  d   TpK  W),           pK  	  VR8w  d   VP                  V4       V# )a
  This splits a command line into a list of arguments. It splits arguments
on spaces, but handles embedded quotes, doublequotes, and escaped
characters. It's impossible to do this with a regular expression, so I
wrote a little state machine to parse the command line. r   Z\Z'Z")ZisspaceZappend)
Zcommand_lineZarg_listZargZstate_basicZ	state_escZstate_singlequoteZstate_doublequoteZstate_whitespaceZstateZcs
   &         r   split_command_liner	   E   s     H
C KIE5#<Dy!d)d),OOC(C,Eg#'CE'Dy#g'Dy#gG J byOr   c                s   Ve   \         P                   ! 4       V,           p  \        P                  ! WW#4      #   \         dy    \        P                  ! 4       ^,          pTP
                  ^ ,          \        P                  8X  d5   Te.   X\         P                   ! 4       ,
          pT^ 8  d   . . . 3u #  K   K  h i ; i)zThis is a wrapper around select.select() that ignores signals. If
select.select raises a select.error exception and errno is an EINTR
error then it is ignored. Mainly this is used to ignore sigwinch
(terminal resize). )timeselectInterruptedErrorr   exc_infoargserrnoEINTR)ZiwtdZowtdZewtdtimeoutend_timeerrs   &&&&  r   select_ignore_interruptsr      s     99;(
	==T;; 	,,.#Cxx{ekk) &&4G{!2rl* # ' 	s   : A9B=;B=c                s   Ve   \         P                   ! 4       V,           p\        P                  ! 4       pV  Fb  pVP                  V\        P                  \        P
                  ,          \        P                  ,          \        P                  ,          4       Kd  	    Vf   RMVR,          pVP                  V4      pV UUu. uF  w  rxVNK	  	  upp# u uppi   \         dv    \        P                  ! 4       ^,          p	T	P                  ^ ,          \        P                  8X  d2   Te+   X\         P                   ! 4       ,
          pT^ 8  d   . u #  K   K  h i ; i)zKSimple wrapper around poll to register file descriptors and
ignore signals.Ni  )r
   r   ZpollZregisterZPOLLINZPOLLPRIZPOLLHUPZPOLLERRr   r   r   r   r   r   )
Zfdsr   r   ZpollerZfdZ
timeout_msZresultsZafdZ_r   s
   &&        r   poll_ignore_interruptsr      s    99;([[]FFMMFNN:V^^Kfnn\]  	!(gnJkk*-G&-.gFCCg... 	,,.#Cxx{ekk) &&4G{!	 # ' 	s%    %C CC C A6EE)N)r    r   r   r   r
   r   r   Z	NameErrorZerrorZversion_infoZstrZstring_typesZunicoder   r   r	   r   r   ) r   r   <module>r      sz    	 
    $
 A!6LS>L%8*:z:k  $||$s   A A)(A)