
    ~f
                         	 d dl mZ  G d de      Zy# e$ r( d dlZd dlZej
                  ej                  z  dfdZY 8w xY w)    )whichNc                 h    d }t         j                  j                         r | |      r S y|.t         j                  j	                  dt         j
                        }|sy|j                  t         j                        }t        j                  dk(  rt         j                  |vr |j                  dt         j                         t         j                  j	                  dd      j                  t         j                        }t         fd|D              r g}n|D cg c]  } |z   	 }}n g}t               }|D ]m  }t         j                  j                  |      }	|	|vs'|j                  |	       |D ]1  }
t         j                  j!                  ||
      } |||      s-|c c S  o yc c}w )	aS  Given a command, mode, and a PATH string, return the path which
        conforms to the given mode on the PATH, or None if there is no such
        file.
    
        `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result
        of os.environ.get("PATH"), or can be overridden with a custom search
        path.
    
        c                     t         j                  j                  |       xr8 t        j                  | |      xr  t         j                  j	                  |        S N)ospathexistsaccessisdir)fnmodes     J/var/www/cvtools/html/venv/lib/python3.12/site-packages/ptyprocess/util.py_access_checkzwhich.<locals>._access_check   sA    GGNN2& .299R+> .GGMM"--/    NPATHwin32r   PATHEXT c              3   x   K   | ]1  }j                         j                  |j                                3 y wr   )lowerendswith).0extcmds     r   	<genexpr>zwhich.<locals>.<genexpr>1   s(     H399;''		4Hs   7:)r   r   dirnameenvirongetdefpathsplitpathsepsysplatformcurdirinsertanysetnormcaseaddjoin)r   r   r   r   pathextfilesr   seendirnormdirthefilenames   `           r   r   r      s`   	/ 77??3S$'
<::>>&"**5Dzz"**%<<7"99$Aryy) jjnnY399"**EG
 HHH.56ss66 EEu 	$Cgg&&s+Gd?!$ $G77<<W5D$T40#$		$  7s    F/c                       e Zd ZdZy)PtyProcessErrorz%Generic error class for this package.N)__name__
__module____qualname____doc__ r   r   r3   r3   F   s    /r   r3   )	shutilr   ImportErrorr   r"   F_OKX_OK	Exceptionr3   r8   r   r   <module>r>      sK   BH0i 0G  @ "'') <	@s    *A A