관리-도구
편집 파일: _compat.cpython-38.pyc
U �Mg�; � @ sJ d Z ddlZddlZddlZddlZddlZddlZddlZddddddd d ddd ddddddgZej d dkZ e� Ze r�e ZeZeZeZeZdd � ZneZeZeZeZdd � Ze r�eZneZeedfdd�Ze r�eZeZeZeZeZeZn�ddlZefdd�Zee �dd� �Zee �dd� �Zee �dd� �Zee �dd� �Zee �dd� �Zee �d d� �Ze�!� d!k�r�ze"ej#d"��W n6 ek �r� Y n" e"k �r� d#Z$e%e$��Y nX zdd$lm&Z& W n� e'k �rf zdd%l(m)Z) W n" e'k �r dd%l*m)Z) Y nX e�+d&d'd(d)d*g�Z,G d+d,� d,e-�Z.efe/e ee0e1d�f�e2e3e1e4fd-d.�Z5d<d1d �Z&Y nX zdd2l6m7Z7 W n, e'k �r� ej8ej9B dfd3d�Z7Y nX zdd4l6m:Z: W n e'k �r� d=d6d�Z:Y nX zdd7l;m<Z= W n& e'k �r G d8d9� d9e�Z=Y nX zdd:lm>Z> W n$ e'k �rD ej?d;d � �Z>Y nX dS )>z�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 �>/opt/hc_python/lib64/python3.8/site-packages/psutil/_compat.pyr 2 s c C s | S �Nr r r r r r ; s � c C sr | t k�rVt�|�}z|j|jjd }W n$ ttfk rN d}t|��Y nX z |j }W nF t tfk r� z|jj }W n t k r� d}t|��Y nX Y nX |D ]�} | j� � D ]�}zTt|tj��s t|t�r�|j}q�z |j}W q� t k �r |�|| �}Y q�X q�W n t tfk �r* Y q�Y nX |j|jkr� �qBq�q� �qVq�d}t|��|t k �rjt| |�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 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 sd t |�dkrNt|d � �rN|d }t|�D ] }|�d�s*t| |t||�� q*nt� | �j||� d S )Nr r �__)�lenr) �dir� startswith�setattr�getattrr �__init__)�self�args�kwargsZ unwrap_me�attr)�TemporaryClassr&