HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/thread-self/root/opt/saltstack/salt/lib/python3.10/__pycache__/warnings.cpython-310.pyc
o

�N�g�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/saltstack/salt/lib/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�tracemallocZ
is_tracingZget_object_traceback)	rr�sr"rr'Ztracing�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)rZswrrr�_showwarnmsg`s��r/cCsLzt}WntyYt|�Sw|tur"||j|j|j|j|j�St|�S)r)	rr+�_formatwarning_origr
rrrrr)rZfwrrrrus�
�r�FcCs�|dvsJd|f��t|t�sJd��t|t�sJd��t|t�s&Jd��t|t�s/Jd��t|t�r8|dks<Jd��|s@|rDdd	l}|rN|�||j�}nd	}|rX|�|�}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
rr7rr<rCrrrr�s&
��rcCsH|dvsJd|f��t|t�r|dksJd��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
    r2r9rr:Nr;)r=rBrF)rGrrr<rrrr�s

��rcGsP|szt�|�Wn	tyYnwt�d|�n	|tvr#t�|�t�dS)Nr)�filters�remove�
ValueError�insertr<�_filters_mutated)r<�itemrrrrF�s�

rFcCsgtdd�<t�dS)zAClear the list of warning filters, so that no filters are active.N)rHrLrrrrr�s
rc@seZdZdZdS)�_OptionErrorz,Exception used by option processing helpers.N)r!�
__module__�__qualname__�__doc__rrrrrN�srNcCsN|D]"}zt|�Wqty$}ztd|tjd�WYd}~qd}~wwdS)NzInvalid -W option ignored:)r)�
_setoptionrN�printrr)�args�argrrrr�_processoptions�s���rVc	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): %rr1cSsg|]}|���qSr)r%)�.0r(rrr�
<listcomp>�s�z_setoption.<locals>.<listcomp>rz\Zzinvalid lineno %r)�split�lenrNr<�
_getaction�_getcategoryrC�escaperBrJ�
OverflowErrorr)rU�partsrGr
rr7rrCrrrrR�s8

��
��rRcCs>|sdS|dkr
dSdD]}|�|�r|Sqtd|f��)Nr6�allr5)r6r5r4r7r8r3r9)�
startswithrN)rG�arrrr\�s
�r\cCs�|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)	rA�builtins�
rpartition�
__import__�ImportErrorrN�getattr�AttributeErrorr@)r�mZklassr7�_�catrrrr]�s&��
r]cCs|jj}d|vod|vS)zFSignal whether the frame is an internal CPython implementation detail.Z	importlib�
_bootstrap)�f_code�co_filename)r*rrrr�_is_internal_framesrqcCs0|j}|durt|�r|j}|durt|�s|S)z;Find the next frame that doesn't involve CPython internals.N)�f_backrq)r*rrr�_next_external_frames
�rs�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}'rtrr!z<string>Z__warningregistry__)r=rA�	__class__�UserWarningr?r@r.�formatr!rqr�	_getframe�rangersrJ�__dict__�	f_globalsrorp�f_lineno�
setdefaultr)r
r�
stacklevelr&r*�x�globalsrrr7�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�versionrr4r3r8rtr5r7r6z1Unrecognized action (%r) in warnings.filters:
 %s)rB�lower�get�_filters_version�clearr=rAr>rurH�matchr@�
defaultactionr"Zgetlines�onceregistry�RuntimeErrorrr/)r
rrrr7r��module_globalsr&r�keyrMrGrrm�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!rOrPZ_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)�recordr7cCs(||_|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�r7rrrr��s
zcatch_warnings.__init__cCsPg}|jr
|�d�|jtjdur|�d|j�t|�j}d|d�|�fS)Nzrecord=Truer�z	module=%rz%s(%s)z, )r�r<r�rr�r?r!�join)r�rT�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�rH�_filtersrLr�_showwarningrr�r<r,)r�Zlogrrr�	__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�rHrLr�rr)r��exc_inforrr�__exit__�s


zcatch_warnings.__exit__)r!rOrPrQr�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)
r1r �)rr~r&)rPr�r"�	tracebackr<Zformat_list�listr��rstripr�RuntimeWarning)r�Z	msg_linesr�r�rrr�r�_warn_unawaited_coroutine�s�

r�)rH�_defaultaction�
_onceregistryrrrLTr6cCstd7adS)Nrt)r�rrrrrLsrLZgettotalrefcount�__main__)rr7r<r4)rr<)NNr)NrtN)NNNN).rQr�__all__rrrrr,r/r0rrArrrFrr$rNrVrRr\r]rqrsrr�objectrr	r��	_warningsrHr�r�rLr�r�Z_warnings_defaultsrhr��warnoptions�hasattr�DeprecationWarning�PendingDeprecationWarning�
ImportWarning�ResourceWarningrrrr�<module>sn

;

�#

	)
�GC �

�