3 Úi«VŒ ã @ sP yd dl mZ W n: ek rJ d dlZd dlZejejB dfdd„ZY nX dS )é )ÚwhichNc s" dd„ }t jjˆ ƒr&|ˆ |ƒr"ˆ S dS |dkr>t jjdt jƒ}|sFdS |jt jƒ}tj dkr¼t j |krt|jdt j ƒ t jjddƒjt jƒ}t‡ fd d „|D ƒƒr¨ˆ g}q‡ fdd„|D ƒ}nˆ g}t ƒ }xT|D ]L}t jj|ƒ}||krÎ|j|ƒ x(|D ] } t jj|| ƒ} || |ƒrö| S qöW qÎW dS ) 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 S s&