ó
	æNXc           @   s]   y d  d l  m Z WnB e k
 rX d  d l Z d  d l Z e j e j Bd d „ Z n Xd S(   iÿÿÿÿ(   t   whichNc            s   d „  } t  j j ˆ  ƒ r2 | ˆ  | ƒ r. ˆ  Sd S| d k rY t  j j d t  j ƒ } n  | sc d S| j t  j ƒ } t	 j
 d k rt  j | k r© | j d t  j ƒ n  t  j j d d ƒ j t  j ƒ } t ‡  f d †  | Dƒ ƒ rò ˆ  g } qg  | D] } ˆ  | ^ qù } n	 ˆ  g } t ƒ  } xu | D]m } t  j j | ƒ }	 |	 | k r+| j |	 ƒ x9 | D]. }
 t  j j | |
 ƒ } | | | ƒ rc| SqcWq+q+Wd S(	   sS  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         S   s5   t  j j |  ƒ o4 t  j |  | ƒ o4 t  j j |  ƒ S(   N(   t   ost   patht   existst   accesst   isdir(   t   fnt   mode(    (    sG   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/ptyprocess/util.pyt   _access_check   s    $t   PATHt   win32i    t   PATHEXTt    c         3   s*   |  ]  } ˆ  j  ƒ  j | j  ƒ  ƒ Vq d  S(   N(   t   lowert   endswith(   t   .0t   ext(   t   cmd(    sG   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/ptyprocess/util.pys	   <genexpr>1   s    N(   R   R   t   dirnamet   Nonet   environt   gett   defpatht   splitt   pathsept   syst   platformt   curdirt   insertt   anyt   sett   normcaset   addt   join(   R   R   R   R   t   pathextt   filesR   t   seent   dirt   normdirt   thefilet   name(    (   R   sG   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/ptyprocess/util.pyR       s8    	! 		(   t   shutilR    t   ImportErrorR   R   t   F_OKt   X_OKR   (    (    (    sG   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/ptyprocess/util.pyt   <module>   s   