![]() Server : Apache/2.4.52 (Ubuntu) System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64 User : www-data ( 33) PHP Version : 8.1.2-1ubuntu2.21 Disable Function : NONE Directory : /lib/python3/dist-packages/pexpect/__pycache__/ |
o ��!^� � @ s� d dl Z d dlZd dlZd dlZd dlZd dlZze W n ey( ejZY nw ej d dkr4e fZnee fZdd� Z d dd�Zdd� Zd d d �Zd dd�ZdS )� N� c C sh t j�| �}t j�|�sdS t �|�j}tj�d�r-t � � dkr-t |tjtjB tj B @ �S t �|t j�S )z�Checks 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)``. F�sunosr )�os�path�realpath�isfile�stat�st_mode�sys�platform� startswith�getuid�bool�S_IXUSR�S_IXGRP�S_IXOTH�access�X_OK)r �fpath�mode� r �//usr/lib/python3/dist-packages/pexpect/utils.py�is_executable_file s ��r c C sv t j�| �dkrt| �r| S |du rt j}|�d�}|st j}|�t j�}|D ]}t j� || �}t|�r8| S q'dS )z�This 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.� N�PATH) r r �dirnamer �environ�get�defpath�split�pathsep�join)�filename�env�p�pathlistr �ffr r r �which0 s �r'