File: //proc/self/root/usr/local/lib64/python3.9/site-packages/psutil/__pycache__/_compat.cpython-39.pyc
a
q�dg�; � @ s d Z ddlZddlZddlZddlZddlZddlZddlZg d�Zej d dkZ
e� Ze
rze
ZeZeZeZeZdd� ZneZeZeZeZdd� Ze
r�eZneZeedfd d
�Ze
r�eZeZeZeZeZeZn�ddlZefdd�Zee �d
d� �Zee �dd� �Zee �dd� �Zee �dd� �Zee �dd� �Zee �dd� �Ze�!� dk�r�ze"ej#d��W n2 e�yt Y n e"�y� dZ$e%e$��Y n0 zddlm&Z& W n� e'�y< zddl(m)Z) W n e'�y� ddl*m)Z) Y n0 e�+dg d��Z,G d d!� d!e-�Z.efe/e
ee0e1d�f�e2e3e1e4fd"d#�Z5d5d&d'�Z&Y n0 zdd(l6m7Z7 W n* e'�yx ej8ej9B dfd)d*�Z7Y n0 zdd+l6m:Z: W n e'�y� d6d-d.�Z:Y n0 zdd/l;m<Z= W n$ e'�y� G d0d1� d1e�Z=Y n0 zdd2lm>Z> W n" e'�y ej?d3d4� �Z>Y n0 dS )7z�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�b� lru_cache�which�get_terminal_size�redirect_stderr�FileNotFoundError�PermissionError�ProcessLookupError�InterruptedError�ChildProcessError�FileExistsError� c C s
| � d�S )Nzlatin-1)�encode��s� r �:/usr/local/lib64/python3.9/site-packages/psutil/_compat.pyr 2 s r c C s | S �Nr r r r r r ; s � c C sd | t u �rHt�|�}z|j|jjd }W n" ttfyL d}t|��Y n0 z
|j }W nB t
tfy� z|jj }W n t
y� d}t|��Y n0 Y n0 |D ]�} | j�
� D ]�}zNt|tj�s�t|t�r�|j}q�z
|j}W q� t
y� |�|| �}Y q�0 q�W n t
tf�y Y q�Y n0 |j|ju r� �q4q�q� �qHq�d}t|��|t u�r\t| |�S t| �S )zuLike Python 3 builtin super(). If called without any arguments
it attempts to infer them at runtime.
r z'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__� TypeError� func_code�_builtin_super)�type_Ztype_or_objZ
framedepth�f�msg�mro�methr r r r J sH
r c s � fdd�}|S )Nc s* G � �fdd�d��� �j � _ �j� _� S )Nc s2 e Zd Z�� fdd�ZG �fdd�de�Z� ZS )zE_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClassc sh t |�dkrNt|d � �rN|d }t|�D ] }|�d�s*t| |t||�� q*nt� | �j|i |�� d S )Nr r �__)�lenr) �dir�
startswith�setattr�getattrr �__init__)�self�args�kwargsZ unwrap_me�attr)�TemporaryClassr&