Hacked By AnonymousFox

Current Path : /proc/thread-self/root/opt/alt/python39/lib64/python3.9/__pycache__/
Upload File :
Current File : //proc/thread-self/root/opt/alt/python39/lib64/python3.9/__pycache__/warnings.cpython-39.pyc

a

R�f�L�@s�dZddlZgd�Zd=dd�Zd>dd�Zdd	�Zd
d�ZeZdd
�ZeZ	dd�Z
dedddfdd�Zeddfdd�Z
dd�Zdd�ZGdd�de�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd?d)d*�Zd@d+d,�ZGd-d.�d.e�ZGd/d0�d0e�Zd1d2�Zz0dd3lmZm Z m!Z!mZmZm"Z"e Z#e!Z$d4Z%Wn0e&�y`gZd5Z#iZ$d(a'd6d7�Z"dZ%Yn0eej(�e%�s�e)ed8��s�ed5e*d9d(d:�e
d;e*d(d<�e
d;e+d(d<�e
d;e,d(d<�e
d;e-d(d<�[%dS)Az&Python part of the warnings subsystem.�N)�warn�
warn_explicit�showwarning�
formatwarning�filterwarnings�simplefilter�
resetwarnings�catch_warningscCst||||||�}t|�dS)�7Hook to write a warning to a file; replace if you like.N)�WarningMessage�_showwarnmsg_impl)�message�category�filename�lineno�file�line�msg�r�-/opt/alt/python39/lib64/python3.9/warnings.pyr
srcCst||||d|�}t|�S)�.Function to format a warning the standard way.N)r�_formatwarnmsg_impl)r
rrrrrrrrrsrcCsN|j}|dur tj}|dur dSt|�}z|�|�WntyHYn0dS�N)r�sys�stderr�_formatwarnmsg�write�OSError)rr�textrrrrsrc		Cs�|jj}|j�d|j�d|�d|j�d�}|jdurnzddl}|�|j|j�}Wqttyjd}d}Yqt0n|j}|r�|�	�}|d|7}|j
du�r�zddl}Wnty�d}d}Yn20|��}z|�
|j
�}Wnty�d}Yn0|du�r||d7}|D]r}|d|j|jf7}z$|du�r<|�|j|j�}nd}Wnt�yZd}Yn0|�r|�	�}|d	|7}�qn|�s�||�d
�7}|S)N�:z: �
rz  %s
Tz-Object allocated at (most recent call last):
z  File "%s", lineno %s
z    %s
z<: Enable tracemalloc to get the object allocation traceback
)r�__name__rrr
r�	linecache�getline�	Exception�strip�source�tracemalloc�
is_tracing�get_object_traceback)	rr�sr"rr'�tracing�tb�framerrrr#sT"




�

rcCsbzt}WntyYn<0|turVt|�s4td��||j|j|j|j|j	|j
�dSt|�dS)r
z:warnings.showwarning() must be set to a function or methodN)r�	NameError�_showwarning_orig�callable�	TypeErrorr
rrrrrr)r�swrrr�_showwarnmsg`s�r3cCsFzt}WntyYn$0|tur>||j|j|j|j|j�St|�S)r)	rr.�_formatwarning_origr
rrrrr)r�fwrrrrus
�r�FcCs�|dvsJd|f��t|t�s(Jd��t|t�s:Jd��t|t�sLJd��t|t�s^Jd��t|t�rp|dksxJd��|s�|r�dd	l}|r�|�||j�}nd	}|r�|�|�}nd	}t	||||||d
�d	S)a�Insert an entry into the list of warnings filters (at the front).

    'action' -- one of "error", "ignore", "always", "default", "module",
                or "once"
    'message' -- a regex that the warning message must match
    'category' -- a class that the warning must be a subclass of
    'module' -- a regex that the module name must match
    'lineno' -- an integer line number, 0 matches all warnings
    'append' -- if true, append to the list of filters
    ��error�ignore�always�default�module�once�invalid action: %rzmessage must be a stringzcategory must be a classz#category must be a Warning subclasszmodule must be a stringr�lineno must be an int >= 0N��append)
�
isinstance�str�type�
issubclass�Warning�int�re�compile�I�_add_filter)�actionr
rr<rrArHrrrr�s&
��rcCsH|dvsJd|f��t|t�r(|dks0Jd��t|d|d||d�dS)a�Insert a simple entry into the list of warnings filters (at the front).

    A simple filter matches all modules and messages.
    'action' -- one of "error", "ignore", "always", "default", "module",
                or "once"
    'category' -- a class that the warning must be a subclass of
    'lineno' -- an integer line number, 0 matches all warnings
    'append' -- if true, append to the list of filters
    r7r>rr?Nr@)rBrGrK)rLrrrArrrr�s

��rcGsP|s4zt�|�Wnty$Yn0t�d|�n|tvrFt�|�t�dS)Nr)�filters�remove�
ValueError�insertrA�_filters_mutated)rA�itemrrrrK�s
rKcCsgtdd�<t�dS)zAClear the list of warning filters, so that no filters are active.N)rMrQrrrrr�src@seZdZdZdS)�_OptionErrorz,Exception used by option processing helpers.N)r!�
__module__�__qualname__�__doc__rrrrrS�srScCsP|D]F}zt|�WqtyH}ztd|tjd�WYd}~qd}~00qdS)NzInvalid -W option ignored:)r)�
_setoptionrS�printrr)�args�argrrrr�_processoptions�s
r[c	Cs�|�d�}t|�dkr$td|f��t|�dkr<|�d�q$dd�|D�\}}}}}t|�}t|�}|sl|rtddl}|r�|�|�}|r�|�|�d}|r�zt|�}|dkr�t	�Wq�t	t
fy�td	|f�d�Yq�0nd}t|||||�dS)
Nr�ztoo many fields (max 5): %rr6cSsg|]}|���qSr)r%)�.0r*rrr�
<listcomp>�s�z_setoption.<locals>.<listcomp>rz\Zzinvalid lineno %r)�split�lenrSrA�
_getaction�_getcategoryrH�escaperGrO�
OverflowErrorr)rZ�partsrLr
rr<rrHrrrrW�s2
�
rWcCsB|sdS|dkrdSdD]}|�|�r|Sqtd|f��dS)Nr;�allr:)r;r:r9r<r=r8r>)�
startswithrS)rL�arrrra�s

racCs�|stSd|vrddl}|}nH|�d�\}}}zt|dd|g�}Wn"tydtd|f�d�Yn0zt||�}Wn"ty�td|f�d�Yn0t|t�s�td|f��|S)N�.rzinvalid module name: %rzunknown warning category: %rzinvalid warning category: %r)	rF�builtins�
rpartition�
__import__�ImportErrorrS�getattr�AttributeErrorrE)r�m�klassr<�_�catrrrrb�s"
rbcCs|jj}d|vod|vS)zFSignal whether the frame is an internal CPython implementation detail.�	importlib�
_bootstrap)�f_code�co_filename)r-rrrr�_is_internal_framesrxcCs"|j}|durt|�r|j}q|S)z;Find the next frame that doesn't involve CPython internals.N)�f_backrx)r-rrr�_next_external_framesrz�c	Cst|t�r|j}|durt}t|t�r0t|t�sDtd�t|�j���zV|dks\t	t
�d��rht
�|�}n0t
�d�}t|d�D]}t
|�}|dur~t�q~Wn ty�t
j}d}d}Yn0|j}|jj}|j}d|vr�|d}	nd}	|�di�}
t|||||	|
||�dS)z:Issue a warning, or maybe ignore it or raise an exception.Nz/category must be a Warning subclass, not '{:s}'r{rr!z<string>Z__warningregistry__)rBrF�	__class__�UserWarningrDrEr1�formatr!rxr�	_getframe�rangerzrO�__dict__�	f_globalsrvrw�f_lineno�
setdefaultr)r
r�
stacklevelr&r-�x�globalsrrr<�registryrrrrs<
�



�rcCs�t|�}|dur8|pd}|dd���dkr8|dd�}|durDi}|�dd�tkrd|��t|d<t|t�r~t|�}|j}n|}||�}|||f}	|�|	�r�dSt	D]V}
|
\}}}
}}|dus�|�
|�r�t||
�r�|dus�|�
|�r�|dks�||kr��qq�t}|dk�rdSddl
}|�||�|dk�r2|�|dk�rfd	||	<||f}t�|��r\dSd	t|<nf|d
k�rrnZ|dk�r�d	||	<||df}|�|��r�dSd	||<n$|dk�r�d	||	<ntd
||
f��t|||||�}t|�dS)Nz	<unknown>���z.py�versionrr9r8r=r{r:r<r;z1Unrecognized action (%r) in warnings.filters:
 %s)rG�lower�get�_filters_version�clearrBrFrCr|rM�matchrE�
defaultactionr"�getlines�onceregistry�RuntimeErrorrr3)r
rrrr<r��module_globalsr&r�keyrRrLrrs�modZlnr"ZoncekeyZaltkeyrrrrGs|


�����









��rc@s"eZdZdZddd�Zdd�ZdS)r)r
rrrrrr&NcCs>||_||_||_||_||_||_||_|r4|jnd|_dSr)	r
rrrrrr&r!�_category_name)�selfr
rrrrrr&rrr�__init__�szWarningMessage.__init__cCsd|j|j|j|j|jfS)NzD{message : %r, category : %r, filename : %r, lineno : %s, line : %r})r
r�rrr)r�rrr�__str__�s
��zWarningMessage.__str__)NNN)r!rTrU�_WARNING_DETAILSr�r�rrrrr�s
�
rc@s8eZdZdZddd�dd�Zdd�Zd	d
�Zdd�ZdS)
r	a�A context manager that copies and restores the warnings filter upon
    exiting the context.

    The 'record' argument specifies whether warnings should be captured by a
    custom implementation of warnings.showwarning() and be appended to a list
    returned by the context manager. Otherwise None is returned by the context
    manager. The objects appended to the list are arguments whose attributes
    mirror the arguments to showwarning().

    The 'module' argument is to specify an alternative module to the module
    named 'warnings' and imported under that name. This argument is only useful
    when testing the warnings module itself.

    FN)�recordr<cCs(||_|durtjdn||_d|_dS)z�Specify whether to record warnings and if an alternative module
        should be used other than sys.modules['warnings'].

        For compatibility with Python 3.0, please consider all arguments to be
        keyword-only.

        N�warningsF)�_recordr�modules�_module�_entered)r�r�r<rrrr��szcatch_warnings.__init__cCsPg}|jr|�d�|jtjdur4|�d|j�t|�j}d|d�|�fS)Nzrecord=Truer�z	module=%rz%s(%s)z, )r�rAr�rr�rDr!�join)r�rY�namerrr�__repr__�s

zcatch_warnings.__repr__cCs~|jrtd|��d|_|jj|_|jdd�|j_|j��|jj|_|jj|_|j	rvg}|j
|j_|jj|j_|SdSdS)NzCannot enter %r twiceT)r�r�r�rM�_filtersrQr�_showwarningrr�rAr/)r��logrrr�	__enter__�s




zcatch_warnings.__enter__cGs>|jstd|��|j|j_|j��|j|j_|j|j_dS)Nz%Cannot exit %r without entering first)	r�r�r�r�rMrQr�rr)r��exc_inforrr�__exit__�s


zcatch_warnings.__exit__)r!rTrUrVr�r�r�r�rrrrr	�s
	r	cszd�j�d�g}�jdurVddl�ddl}��fdd�}|�d�||�t|���7}d�|��d�}t	|t
d	�d
�dS)Nzcoroutine 'z' was never awaited
rc3s4t�j�D]$\}}}��||�}||||fVq
dSr)�reversed�	cr_originr#)rr�funcnamer��coror"rr�extract�sz*_warn_unawaited_coroutine.<locals>.extractz-Coroutine created at (most recent call last)
r6r �)rr�r&)rUr�r"�	tracebackrA�format_list�listr��rstripr�RuntimeWarning)r��	msg_linesr�r�rrr�r�_warn_unawaited_coroutine�s�

r�)rM�_defaultaction�
_onceregistryrrrQTr;cCstd7adS)Nr{)r�rrrrrQsrQZgettotalrefcount�__main__)rr<rAr9)rrA)NN)N)Nr{N)NNNN).rVr�__all__rrrrr/r3r4rrFrrrKrr$rSr[rWrarbrxrzrr�objectrr	r��	_warningsrMr�r�rQr�r�Z_warnings_defaultsrmr��warnoptions�hasattr�DeprecationWarning�PendingDeprecationWarning�
ImportWarning�ResourceWarningrrrr�<module>sj

;
�
#
	
)�
GC 

�

Hacked By AnonymousFox1.0, Coded By AnonymousFox