AlkantarClanX12

Your IP : 3.144.43.194


Current Path : /opt/alt/python310/lib64/python3.10/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/__pycache__/warnings.cpython-310.opt-1.pyc

o

6��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*�Z		d@d+d,�ZGd-d.�d.e�ZGd/d0�d0e�Zd1d2�Zzdd3lmZm Z m!Z!mZmZm"Z"e Z#e!Z$d4Z%Wne&y�gZd5Z#iZ$d(a'd6d7�Z"dZ%Ynweej(�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/python310/lib64/python3.10/warnings.pyr
srcCst||||d|�}t|�S)�.Function to format a warning the standard way.N)r�_formatwarnmsg_impl)r
rrrrrrrrrsrcCsN|j}|durtj}|durdSt|�}z|�|�WdSty&YdSw�N)r�sys�stderr�_formatwarnmsg�write�OSError)rr�textrrrrs�rc		Cs�|jj}|j�d|j�d|�d|j�d�}|jdur6zddl}|�|j|j�}Wnty5d}d}Ynw|j}|rE|�	�}|d|7}|j
dur�zddl}Wn
ty]d}d}Ynw|��}z|�
|j
�}Wntyud}Ynw|dur�|d7}|D]5}|d|j|jf7}z|dur�|�|j|j�}nd}Wnty�d}Ynw|r�|�	�}|d	|7}q�|S|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#sb"
�
��
�����rcCsbzt}Wn	ty
Ynw|tur+t|�std��||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��r3cCsLzt}WntyYt|�Sw|tur"||j|j|j|j|j�St|�S)r)	rr.�_formatwarning_origr
rrrrr)r�fwrrrrus�
�r�FcCsT|s|rddl}|r|�||j�}nd}|r|�|�}nd}t||||||d�dS)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
    rN��append)�re�compile�I�_add_filter)�actionr
r�modulerr8r9rrrr�srcCst|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
    Nr7)r<)r=rrr8rrrr�srcGsP|szt�|�Wn	tyYnwt�d|�n	|tvr#t�|�t�dS)Nr)�filters�remove�
ValueError�insertr8�_filters_mutated)r8�itemrrrr<�s�

r<cCsgtdd�<t�dS)zAClear the list of warning filters, so that no filters are active.N)r?rCrrrrr�s
rc@seZdZdZdS)�_OptionErrorz,Exception used by option processing helpers.N)r!�
__module__�__qualname__�__doc__rrrrrE�srEcCsN|D]"}zt|�Wqty$}ztd|tjd�WYd}~qd}~wwdS)NzInvalid -W option ignored:)r)�
_setoptionrE�printrr)�args�argrrrr�_processoptions�s���rMc	Cs�|�d�}t|�dkrtd|f��t|�dkr#|�d�t|�dksdd�|D�\}}}}}t|�}t|�}|s;|r?ddl}|rF|�|�}|rO|�|�d}|rozt|�}|dkr\t	�Wnt	t
fyntd	|f�d�wd}t|||||�dS)
Nr�ztoo many fields (max 5): %rr6cSsg|]}|���qSr)r%)�.0r*rrr�
<listcomp>�s�z_setoption.<locals>.<listcomp>rz\Zzinvalid lineno %r)�split�lenrEr8�
_getaction�_getcategoryr9�escape�intrA�
OverflowErrorr)rL�partsr=r
rr>rr9rrrrI�s8

��
��rIcCs>|sdS|dkr
dSdD]}|�|�r|Sqtd|f��)N�default�all�always)rYr[�ignorer>�once�errorzinvalid action: %r)�
startswithrE)r=�arrrrS�s
�rScCs�|stSd|vrddl}|}n"|�d�\}}}z
t|dd|g�}Wnty0td|f�d�wzt||�}WntyGtd|f�d�wt|t�sTtd|f��|S)N�.rzinvalid module name: %rzunknown warning category: %rzinvalid warning category: %r)	�Warning�builtins�
rpartition�
__import__�ImportErrorrE�getattr�AttributeError�
issubclass)r�m�klassr>�_�catrrrrT�s&��
rTcCs|jj}d|vod|vS)zFSignal whether the frame is an internal CPython implementation detail.�	importlib�
_bootstrap)�f_code�co_filename)r-rrrr�_is_internal_framesrrcCs0|j}|durt|�r|j}|durt|�s|S)z;Find the next frame that doesn't involve CPython internals.N)�f_backrr)r-rrr�_next_external_frames
�rt�c	Cst|t�r|j}|durt}t|t�rt|t�s"td�t|�j���z+|dks.t	t
�d��r4t
�|�}nt
�d�}t|d�D]}t
|�}|durKt�q?Wnty]t
j}d}d}Ynw|j}|jj}|j}d|vrq|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}'rurr!z<string>Z__warningregistry__)�
isinstancerb�	__class__�UserWarning�typerir1�formatr!rrr�	_getframe�rangertrA�__dict__�	f_globalsrprq�f_lineno�
setdefaultr)r
r�
stacklevelr&r-�x�globalsrrr>�registryrrrrsB
�
���
�rcCs�t|�}|dur|pd}|dd���dkr|dd�}|dur"i}|�dd�tkr2|��t|d<t|t�r?t|�}|j}n|}||�}|||f}	|�|	�rQdSt	D]*}
|
\}}}
}}|duse|�
|�r}t||
�r}|duss|�
|�r}|dks{||kr}nqSt}|dkr�dSddl
}|�||�|dkr�|�|dkr�d	||	<||f}t�|�r�dSd	t|<n/|d
kr�n*|dkr�d	||	<||df}|�|�r�dSd	||<n|dkr�d	||	<ntd
||
f��t|||||�}t|�dS)Nz	<unknown>���z.py�versionrr\r^r]rur[r>rYz1Unrecognized action (%r) in warnings.filters:
 %s)rV�lower�get�_filters_version�clearrvrb�strrwr?�matchri�
defaultactionr"�getlines�onceregistry�RuntimeErrorrr3)r
rrrr>r��module_globalsr&r�keyrDr=rrm�modZlnr"ZoncekeyZaltkeyrrrrGsr


��





��rc@s&eZdZdZ		ddd�Zdd�ZdS)r)r
rrrrrr&NcCsD||_||_||_||_||_||_||_|r|j|_dSd|_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!rFrG�_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(||_|durtjdn||_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��s
zcatch_warnings.__init__cCsPg}|jr
|�d�|jtjdur|�d|j�t|�j}d|d�|�fS)Nzrecord=Truer�z	module=%rz%s(%s)z, )r�r8r�rr�ryr!�join)r�rK�namerrr�__repr__�s

zcatch_warnings.__repr__cCsz|jr	td|��d|_|jj|_|jdd�|j_|j��|jj|_|jj|_|j	r;g}|j
|j_|jj|j_|SdS)NzCannot enter %r twiceT)r�r�r�r?�_filtersrCr�_showwarningrr�r8r/)r��logrrr�	__enter__�s




zcatch_warnings.__enter__cGs>|js	td|��|j|j_|j��|j|j_|j|j_dS)Nz%Cannot exit %r without entering first)	r�r�r�r�r?rCr�rr)r��exc_inforrr�__exit__�s


zcatch_warnings.__exit__)r!rFrGrHr�r�r�r�rrrrr	�s	r	cszd�j�d�g}�jdur+ddl�ddl}��fdd�}|�d�||�t|���7}d�|��d�}t	|t
d	�d
�dS)Nzcoroutine 'z' was never awaited
rc3s6�t�j�D]\}}}��||�}||||fVqdSr)�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&)rGr�r"�	tracebackr8�format_list�listr��rstripr�RuntimeWarning)r��	msg_linesr�r�rrr�r�_warn_unawaited_coroutine�s�

r�)r?�_defaultaction�
_onceregistryrrrCTrYcCstd7adS)Nru)r�rrrrrCsrCZgettotalrefcount�__main__)rr>r8r\)rr8)NNr)NruN)NNNN).rHr�__all__rrrrr/r3r4rrbrrr<rr$rErMrIrSrTrrrtrr�objectrr	r��	_warningsr?r�r�rCr�r�Z_warnings_defaultsrfr��warnoptions�hasattr�DeprecationWarning�PendingDeprecationWarning�
ImportWarning�ResourceWarningrrrr�<module>sn

;

�#

	)
�GC �

�