HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/psutil/__pycache__/_compat.cpython-310.pyc
o

�N�g�8�@s�dZddlZddlZddlZddlZddlZddlZgd�ZejddkZ	e
�Ze	r=eZ
eZeZeZeZdd�Zdd�Zne
Z
eZeZeZd	d�Zd
d�Ze	rReZn
eZeedfdd
�Ze	rkeZeZeZeZeZeZnZddlZefdd�Zee �dd��Zee �dd��Zee �dd��Zee �dd��Zee �dd��Zee �dd��Ze�!�dkr�ze"ej#d��ey�Yne"y�e$d��wzddlm%Z%WnLe&�yzdd l'm(Z(Wne&y�dd l)m(Z(Ynwe�*d!gd"��Z+Gd#d$�d$e,�Z-e
�fe.eee/e0d�f�e1e2e0e3fd%d&�Z4d2d)d*�Z%Ynwzdd+l5m6Z6Wne&�y7ej7ej8Bdfd,d-�Z6Ynwz	dd.l5m9Z9WdSe&�yQd3d0d1�Z9YdSw)4z�Module which provides compatibility with older Python versions.
This is more future-compatible rather than the opposite (prefer latest
Python 3 way of doing things).
�N)�PY3�long�range�super�unicode�
basestring�u�b�	lru_cache�which�get_terminal_size�FileNotFoundError�PermissionError�ProcessLookupError�InterruptedError�ChildProcessError�FileExistsError�cC�|S�N���srr�B/opt/saltstack/salt/lib/python3.10/site-packages/psutil/_compat.pyr+�rcCs
|�d�S)Nzlatin-1)�encoderrrrr	.�
r	cCs
t|d�S)NZunicode_escape)rrrrrr6rcCrrrrrrrr	9r�cCsJ|tur�t�|�}z|j|jjd}Wn
ttfy!td��wz|j	}Wnt
tfyDz|jj	}Wnt
yAtd��wYnw|D]L}|j�
�D]B}z,t|tj�s{t|t�r`|j}nz|j}Wnt
yt|�||�}Ynwt|tj�rWWnt
tfy�YqNw|j|jur�nqNqGntd��|tur�t||�St|�S)zuLike Python 3 builtin super(). If called without any arguments
        it attempts to infer them at runtime.
        rz'super() used in a function with no argsz$super() used in a non-newstyle classzsuper() called outside a method)�	_SENTINEL�sys�	_getframe�f_locals�f_code�co_varnames�
IndexError�KeyError�RuntimeError�__mro__�AttributeError�	__class__�__dict__�values�
isinstance�types�FunctionType�property�fget�__func__�__get__�	TypeErrorZ	func_code�_builtin_super)Ztype_Ztype_or_objZ
framedepth�f�mro�methrrrrHsT
�
���

�����
rcs�fdd�}|S)Ncs*G��fdd�d����j�_�j�_�S)Ncs2eZdZ��fdd�ZG�fdd�de�Z�ZS)zE_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClasscsjt|�dkr(t|d��r(|d}t|�D]}|�d�s%t||t||��qdSt�|�j|i|��dS)Nrr�__)�lenr,�dir�
startswith�setattr�getattrr�__init__)�self�args�kwargsZ	unwrap_me�attr)�TemporaryClassr)rrr>�s
��zN_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClass.__init__cs eZdZ�fdd�Zdd�ZdS)zS_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClass.__metaclass__cs�|�Srr)�cls�inst��instance_checkerrr�__instancecheck__�sze_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClass.__metaclass__.__instancecheck__cSst��d}t||�S�Nr)r�exc_infor,)rDZ	classinfo�valuerrr�__subclasscheck__�s
ze_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClass.__metaclass__.__subclasscheck__N)�__name__�
__module__�__qualname__rHrLrrFrr�
__metaclass__�srP)rMrNrOr>�typerP�
__classcell__r�rCrG)r)rrC�s	rC)rM�__doc__rF��base_exceptionrSr�wrapped�sz-_instance_checking_exception.<locals>.wrappedr)rVrWrrUr�_instance_checking_exception�srXcC�t|dt�tjkS�N�errno)r=rr[�ENOENT�rErrrr
��r
cCrYrZ)r=rr[ZESRCHr]rrrr�r^rcCst|dt�tjtjfvSrZ)r=rr[ZEACCES�EPERMr]rrrr�s
�rcCrYrZ)r=rr[ZEINTRr]rrrr�r^rcCrYrZ)r=rr[ZECHILDr]rrrr�r^rcCrYrZ)r=rr[�EEXISTr]rrrr�r^r�CPython�permzbbroken or incompatible Python implementation, see: https://github.com/giampaolo/psutil/issues/1659)r
)�RLock�	CacheInfo)�hits�misses�maxsize�currsizec@s$eZdZdZefdd�Zdd�ZdS)�
_HashedSeq�	hashvaluecCs||dd�<||�|_dSr�rj)r?�tup�hashrrrr>�sz_HashedSeq.__init__cCs|jSrrk)r?rrr�__hash__�sz_HashedSeq.__hash__N)rMrNrO�	__slots__rmr>rnrrrrri�sric	s�|}	|r||���}
|	|7}	|
D]}|	|7}	q|r9|	|�fdd�|D��7}	|r5|	|�fdd�|
D��7}	t|	�S||	�dkrK�|	d�|vrK|	dSt|	�S)Nc3s�|]}�|�VqdSrr)�.0�v�rQrr�	<genexpr>�s�z_make_key.<locals>.<genexpr>c3s�|]	\}}�|�VqdSrr)rp�krqrrrrrs�s�rr)�itemsri)r@�kwds�typed�kwd_mark�	fasttypes�sorted�tuplerQr9�keyZsorted_items�itemrrrr�	_make_key�s
�r~�dFcs��fdd�}|S)z~Least-recently-used cache decorator, see:
        http://docs.python.org/3/library/functools.html#functools.lru_cache
        cst��ddg�
d\��t�
�j�t�t��	g���ddg�dd�<�g�d\�����dkr7��
�fdd�}n(�durJ�����
��
��f	dd�}n����������	�
���
��fdd�}����	��
fdd	�}��	��
fd
d�}�|_||_||_t�	|��S)Nr)rr)rr�rcs"�|i|��}��d7<|SrIr)r@rv�result)�MISSES�stats�
user_functionrr�wrapper	sz7lru_cache.<locals>.decorating_function.<locals>.wrappercs\�||��}�|��}|�ur��d7<|S�|i|��}|�|<��d7<|SrIr)r@rvr|r�)	�HITSr��cache�	cache_get�make_key�rootr�rwr�rrr�s
cs�|s�r�
||��}n|}�	��zB�|�}|durN�\}|\}}}}||�<||�<|�}||�<|�<||�<||�<�
�d7<|W�	��SW�	��n�	��w�|i|��}�	��zY�\}|�vrmnB����kr�|}	||	�<||	�<|	�}�d<|�}
d|�<|�<�|
=|	�|<n|�}||||g}||�<|�<�|<�
�d7<W�	��|S�	��w)Nrr)�acquire�release)r@rvr|�linkr�Z	link_prevZ	link_nextr��lastZoldrootZoldkey)r��KEYr��NEXT�PREV�RESULT�_lenr�r��lockr�rg�
nonlocal_rootr�rwr�rrr�sT
�

�cs8���zt�����t���W���S���w)zReport cache statistics)r��
_CacheInfor9r�r)r�r�r�r�rgr�rr�
cache_infoFs�z:lru_cache.<locals>.decorating_function.<locals>.cache_infocsV���z!����d}||ddg|dd�<ddg�dd�<W���dS���w)z$Clear the cache and cache statisticsrN)r��clearr�)r�)r�r�r�r�rr�cache_clearOsz;lru_cache.<locals>.decorating_function.<locals>.cache_clear)
�dictr~�getr9rc�__wrapped__r�r��	functools�update_wrapper)r�r�r�r��rgrw)r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�decorating_function�s,*-	z&lru_cache.<locals>.decorating_functionr)rgrwr�rr�rr
�scr
)rcs"dd�}tj���r|�|�r�SdS|durtj�dtj�}|s#dS|�tj�}tj	dkr^tj
|vr:|�dtj
�tj�dd��tj�}t�fd	d
�|D��rT�g}n
�fdd�|D�}n�g}t
�}|D](}tj�|�}||vr�|�|�|D]}	tj�||	�}
||
|�r�|
SqyqfdS)
aJGiven 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.
        cSs&tj�|�ot�||�otj�|�Sr)�os�path�exists�access�isdir)�fn�moderrr�
_access_checkos�zwhich.<locals>._access_checkN�PATH�win32r�PATHEXT�c3s"�|]}����|���VqdSr)�lower�endswith�rp�ext��cmdrrrs�s� zwhich.<locals>.<genexpr>csg|]}�|�qSrrr�r�rr�
<listcomp>�szwhich.<locals>.<listcomp>)r�r��dirname�environr��defpath�split�pathsepr�platform�curdir�insert�any�set�normcase�add�join)r�r�r�r��pathext�files�seenr:�normdir�thefile�namerr�rrfs<	




��r)r��P�cCsvzddl}ddl}ddl}Wnty|YSwz|�d|�d|jd��}|d|dfWSty:|YSw)NrZhhrZ1234)�fcntl�termios�struct�ImportError�unpack�ioctlZ
TIOCGWINSZ�	Exception)�fallbackr�r�r��resrrrr�s���r)rF)r�):rT�collectionsr[r�r�rr-�__all__�version_infor�objectr�intrrZxrange�strrrrr	rr4r
rrrrrr�r�rX�EnvironmentError�python_implementation�OSErrorr`r&r
r��	threadingrcZdummy_threading�
namedtupler��listrir��	frozensetrQrzr{r9r~�shutilr�F_OK�X_OKrrrrr�<module>s�

8





����
���2�