%PDF- %PDF-
 Mini Shell
 Mini Shell  
 | Direktori : /usr/lib/python3/dist-packages/ptyprocess/__pycache__/ | 
| Current File : //usr/lib/python3/dist-packages/ptyprocess/__pycache__/util.cpython-312.pyc | 
�
    �.�c�
  �                   �   � 	 d dl mZ  G d� de�      Zy# e$ r( d dlZd dlZej
                  ej                  z  dfd�ZY �8w xY w)�    )�whichNc                 �h  � � d� }t         j                  j                  � �      r |� |�      r� S y|�.t         j                  j	                  dt         j
                  �      }|sy|j
                  t         j                  �      }t        j                  dk(  r�t         j                  |vr |j                  dt         j                  �       t         j                  j	                  dd�      j
                  t         j                  �      }t        � fd�|D �       �      r� g}n|D �cg c]  }� |z   ��	 }}n� g}t        �       }|D ]m  }t         j                  j                  |�      }	|	|vs�'|j                  |	�       |D ]1  }
t         j                  j!                  ||
�      } |||�      s�-|c c S  �o yc 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                  | �      xr8 t        j                  | |�      xr  t         j                  j	                  | �       S �N)�os�path�exists�access�isdir)�fn�modes     �1/usr/lib/python3/dist-packages/ptyprocess/util.py�
_access_checkzwhich.<locals>._access_check   sA   � ��G�G�N�N�2�&� .�2�9�9�R��+>� .��G�G�M�M�"�-�-�
/�    N�PATH�win32r   �PATHEXT� c              3   �x   �K  � | ]1  }�j                  �       j                  |j                  �       �      �� �3 y �wr   )�lower�endswith)�.0�ext�cmds     �r   �	<genexpr>zwhich.<locals>.<genexpr>1   s(   �� �� �H��3�9�9�;�'�'��	�	��4�H�s   �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`  �� �	/� �7�7�?�?�3���S�$�'��
���<��:�:�>�>�&�"�*�*�5�D����z�z�"�*�*�%���<�<�7�"��9�9��$����A�r�y�y�)� �j�j�n�n�Y��3�9�9�"�*�*�E�G�
 �H��H�H����.5�6�s��s��6��6� �E�E��u��� 	$�C��g�g�&�&�s�+�G��d�?�����!�$� $�G��7�7�<�<��W�5�D�$�T�4�0�#��$�		$� �� 7s   � F/c                   �   � e Zd ZdZy)�PtyProcessErrorz%Generic error class for this package.N)�__name__�
__module__�__qualname__�__doc__� r   r   r3   r3   F   s   � �/r   r3   )	�shutilr   �ImportErrorr   r"