Repository URL to install this package:
|
Version:
2.0.0rc1 ▾
|
o
õbÃ: ã @ s d Z ddlZddlZddlZddlZddlZddlZddlZg d¢Zej d dkZ
e Ze
rAe
ZeZeZeZeZdd Zdd ZneZeZeZeZd d Zd
d Ze
rVeZn
eZeedfdd
Ze
roeZeZeZeZeZeZnZddlZefddZ e e!dd Ze e!dd Ze e!dd Ze e!dd Ze e!dd Ze e!dd Ze "¡ dkrÉze#ej$d ey¾ Y n e#yÈ e%dw zddlm&Z& W nL e'y zdd l(m)Z) W n e'yð dd l*m)Z) Y nw e +d!g d"¢¡Z,G d#d$ d$e-Z.e fe/e
ee0e1dfe2e3e1e4fd%d&Z5d8d)d*Z&Y nw zdd+l6m7Z7 W n e'y; ej8ej9B dfd,d-Z7Y nw zdd.l6m:Z: W n e'yS d9d0d1Z:Y nw zdd2l;m<Z= W n e'ym G d3d4 d4Z=Y nw z dd5lm>Z> W dS e'y ej?d6d7 Z>Y dS w ):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ÚuÚbÚ lru_cacheÚwhichÚget_terminal_sizeÚredirect_stderrÚFileNotFoundErrorÚPermissionErrorÚProcessLookupErrorÚInterruptedErrorÚChildProcessErrorÚFileExistsErroré c C ó | S ©N© ©Úsr r ú5/tmp/pip-target-wec6zj2z/lib/python/psutil/_compat.pyr / ó r c C s
| d¡S )Nzlatin-1)Úencoder r r r r 2 ó
r c C s
t | dS )NÚunicode_escape)r r r r r r : r c C r r r r r r r r = r é c C sJ | t u rt |¡}z|j|jjd }W n
ttfy! tdw z|j }W n t
tfyD z|jj }W n t
yA tdw Y nw |D ]L} | j
¡ D ]B}z,t|tjs{t|tr`|j}nz|j}W n t
yt | || ¡}Y nw t|tjrWW n t
tfy Y qNw |j|ju r qqNqG qtd|t ur¡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 methodN)Ú _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ÚmroÚmethr r r r L sT
ÿ
ÿÿþ
ÿ÷ÿÿ
r c s fdd}|S )Nc s* G fddd j _ j _ S )Nc s2 e Zd Z fddZG fdddeZ ZS )zE_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClassc sj t |dkr(t|d r(|d }t|D ]}| d¡s%t| |t|| qd S t | j|i |¤ d S )Nr r Ú__)Úlenr. ÚdirÚ
startswithÚsetattrÚgetattrr Ú__init__)ÚselfÚargsÚkwargsZ unwrap_meÚattr)ÚTemporaryClassr+ r r rB s
þzN_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClass.__init__c s e Zd Z fddZdd ZdS )zS_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClass.__metaclass__c s |S r r )ÚclsÚinst©Úinstance_checkerr r Ú__instancecheck__ s ze_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClass.__metaclass__.__instancecheck__c S s t ¡ d }t|| S ©Nr )r! Úexc_infor. )rH Z classinfoÚvaluer r r Ú__subclasscheck__¡ s
ze_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClass.__metaclass__.__subclasscheck__N)Ú__name__Ú
__module__Ú__qualname__rL rP r rJ r r Ú
__metaclass__ s rT )rQ rR rS rB ÚtyperT Ú
__classcell__r ©rG rK )r+ r rG s rG )rQ Ú__doc__rJ ©Úbase_exceptionrW r Úwrapped s z-_instance_checking_exception.<locals>.wrappedr )rZ r[ r rY r Ú_instance_checking_exception s r\ c C ó t | dttjkS ©NÚerrno)rA r r_ ÚENOENT©rI r r r r « ó r c C r] r^ )rA r r_ ZESRCHra r r r r ¯ rb r c C s t | dttjtjfv S r^ )rA r r_ ÚEACCESÚEPERMra r r r r ³ s
ÿr c C r] r^ )rA r r_ ZEINTRra r r r r ¸ rb r c C r] r^ )rA r r_ ZECHILDra r r r r ¼ rb r c C r] r^ )rA r r_ ÚEEXISTra r r r r À rb r ÚCPythonÚpermzbbroken or incompatible Python implementation, see: https://github.com/giampaolo/psutil/issues/1659)r
)ÚRLockÚ CacheInfo)ÚhitsÚmissesÚmaxsizeÚcurrsizec @ s$ e Zd ZdZefddZdd ZdS )Ú
_HashedSeqÚ hashvaluec C s || d d
<