ok

Mini Shell

Direktori : /proc/thread-self/root/opt/alt/python37/lib64/python3.7/__pycache__/
Upload File :
Current File : //proc/thread-self/root/opt/alt/python37/lib64/python3.7/__pycache__/warnings.cpython-37.pyc

B

� fpN�@s�dZddlZddddddd	d
gZd<dd�Zd=dd�Zd
d�Zdd�ZeZdd�ZeZ	dd�Z
dedddfdd�Zeddfdd�Z
dd�Zdd	�ZGdd�de�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd>d+d�Zd?d,d�ZGd-d.�d.e�ZGd/d
�d
e�Zd0d1�Zy0dd2lmZm Z m!Z!mZmZm"Z"e Z#e!Z$d3Z%Wn2e&k
�rngZd4Z#iZ$d*a'd5d6�Z"dZ%YnXeej(�e%�s�e)ed7��s�ed4e*d8d*d9�e
d:e*d*d;�e
d:e+d*d;�e
d:e,d*d;�e
d:e-d*d;�[%dS)@z&Python part of the warnings subsystem.�N�warn�
warn_explicit�showwarning�
formatwarning�filterwarnings�simplefilter�
resetwarnings�catch_warningscCst||||||�}t|�dS)z7Hook 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/python37/lib64/python3.7/warnings.pyr
scCst||||d|�}t|�S)z.Function to format a warning the standard way.N)r
�_formatwarnmsg_impl)rr
rrrrrrrrscCsP|j}|dkr tj}|dkr dSt|�}y|�|�Wntk
rJYnXdS)N)r�sys�stderr�_formatwarnmsg�write�OSError)rr�textrrrrsrc		Cs�|jj}|j�d|j�d|�d|j�d�}|jdkrpyddl}|�|j|j�}Wqvtk
rld}d}YqvXn|j}|r�|�	�}|d|7}|j
dk	�r�yddl}Wntk
r�d}d}Yn4X|��}y|�
|j
�}Wntk
r�d}YnX|dk	�r�|d7}x�|D]t}|d|j|jf7}y$|dk	�rD|�|j|j�}nd}Wntk
�rdd}YnX|�r|�	�}|d	|7}�qWn|�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
�srrr$�tracing�tb�framerrrr#sR"






rcCsdyt}Wntk
rYn<X|tk	rXt|�s6td��||j|j|j|j|j	|j
�dSt|�dS)z7Hook to write a warning to a file; replace if you like.z:warnings.showwarning() must be set to a function or methodN)r�	NameError�_showwarning_orig�callable�	TypeErrorrr
rrrrr)r�swrrr�_showwarnmsg`sr0cCsHyt}Wntk
rYn$X|tk	r@||j|j|j|j|j�St|�S)z.Function to format a warning the standard way.)	rr+�_formatwarning_origrr
rrrr)r�fwrrrrus
r�FcCs�|dkstd|f��t|t�s(td��t|t�s:td��t|t�sLtd��t|t�s^td��t|t�rp|dksxtd��|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�oncezinvalid action: %rzmessage must be a stringzcategory must be a classz#category must be a Warning subclasszmodule must be a stringrzlineno must be an int >= 0N)�append)�AssertionError�
isinstance�str�type�
issubclass�Warning�int�re�compile�I�_add_filter)�actionrr
r8rr:rBrrrr�s"
cCsH|dkstd|f��t|t�r(|dks0td��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
    )r4r5r6r7r8r9zinvalid action: %rrzlineno must be an int >= 0N)r:)r;r<rArE)rFr
rr:rrrr�s


cGsR|s6yt�|�Wntk
r&YnXt�d|�n|tkrHt�|�t�dS)Nr)�filters�remove�
ValueError�insertr:�_filters_mutated)r:�itemrrrrE�s
rEcCsgtdd�<t�dS)zAClear the list of warning filters, so that no filters are active.N)rGrKrrrrr�sc@seZdZdZdS)�_OptionErrorz,Exception used by option processing helpers.N)r�
__module__�__qualname__�__doc__rrrrrM�srMcCsRxL|D]D}yt|�Wqtk
rH}ztd|tjd�Wdd}~XYqXqWdS)NzInvalid -W option ignored:)r)�
_setoptionrM�printrr)�args�argrrrr�_processoptions�s

rUc	Cs�|�d�}t|�dkr$td|f��xt|�dkr>|�d�q&Wdd�|D�\}}}}}t|�}t|�}|sp|rxddl}|r�|�|�}|r�|�|�d}|r�yt|�}|dkr�t	�Wq�t	t
fk
r�td	|f�d�Yq�Xnd}t|||||�dS)
Nr�ztoo many fields (max 5): %rr3cSsg|]}|���qSr)r")�.0r'rrr�
<listcomp>�sz_setoption.<locals>.<listcomp>rz\Zzinvalid lineno %r)�split�lenrMr:�
_getaction�_getcategoryrB�escaperArI�
OverflowErrorr)rT�partsrFrr
r8rrBrrrrQ�s0

rQcCsB|sdS|dkrdSxdD]}|�|�r|SqWtd|f��dS)Nr7�allr6)r7r6r5r8r9r4zinvalid action: %r)�
startswithrM)rF�arrrr[�s

r[cCs�|stSd|krddl}|}nJ|�d�\}}}yt|dd|g�}Wn$tk
rftd|f�d�YnXyt||�}Wn$tk
r�td|f�d�YnXt|t�s�td|f��|S)N�.rzinvalid module name: %rzunknown warning category: %rzinvalid warning category: %r)	r@�builtins�
rpartition�
__import__�ImportErrorrM�getattr�AttributeErrorr?)r
�m�klassr8�_�catrrrr\�s"
r\cCs|jj}d|kod|kS)zFSignal whether the frame is an internal CPython implementation detail.�	importlib�
_bootstrap)�f_code�co_filename)r*rrrr�_is_internal_framesrrcCs&|j}x|dk	r t|�r |j}qW|S)z;Find the next frame that doesn't involve CPython internals.N)�f_backrr)r*rrr�_next_external_frames
rt�c	Csvt|t�r|j}|dkrt}t|t�r0t|t�sDtd�t|�j���yZ|dks\t	t
�d��rht
�|�}n4t
�d�}x(t|d�D]}t
|�}|dkr�t�q�WWntk
r�t
j}d}YnX|j}|j}d|kr�|d}nd}|�d�}	|	�r|	��}
|
�d��rP|	dd�}	n>|d	k�rFyt
jd
}	Wntk
�rDd	}	YnX|	�sP|}	|�di�}t|||	|||||�dS)z:Issue a warning, or maybe ignore it or raise an exception.Nz/category must be a Warning subclass, not '{:s}'rurz<string>�__file__z.pyc����__main__rZ__warningregistry__)r<r@�	__class__�UserWarningr>r?r.�formatrrrr�	_getframe�rangertrI�__dict__�	f_globals�f_lineno�get�lower�endswith�argvri�
setdefaultr)rr
�
stacklevelr#r*�x�globalsrr8rZfnl�registryrrrrsL






cCs�t|�}|dkr8|pd}|dd���dkr8|dd�}|dkrDi}|�dd�tkrd|��t|d<t|t�r~t|�}|j}n|}||�}|||f}	|�|	�r�dSx^t	D]R}
|
\}}}
}}|dks�|�
|�r�t||
�r�|dks�|�
|�r�|dks�||kr�Pq�Wt}|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�versionrr5r4r9rur6r8r7z1Unrecognized action (%r) in warnings.filters:
 %s)rAr�r��_filters_version�clearr<r@r=ryrG�matchr?�
defaultactionr�getlines�onceregistry�RuntimeErrorr
r0)rr
rrr8r��module_globalsr#r�keyrLrFrrm�modZlnrZoncekeyZaltkeyrrrrSsj














c@s"eZdZdZddd�Zdd�ZdS)r
)rr
rrrrr#NcCs>||_||_||_||_||_||_||_|r4|jnd|_dS)N)	rr
rrrrr#r�_category_name)�selfrr
rrrrr#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__�szWarningMessage.__str__)NNN)rrNrO�_WARNING_DETAILSr�r�rrrrr
�s

r
c@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)�recordr8cCs(||_|dkrtjdn||_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�r8rrrr��szcatch_warnings.__init__cCsPg}|jr|�d�|jtjdk	r4|�d|j�t|�j}d|d�|�fS)Nzrecord=Truer�z	module=%rz%s(%s)z, )r�r:r�rr�r>r�join)r�rS�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�rG�_filtersrKr�_showwarningrr�r:r,)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�rGrKr�rr)r��exc_inforrr�__exit__�s


zcatch_warnings.__exit__)rrNrOrPr�r�r�r�rrrrr	�s
	cszd�j�d�g}�jdk	rVddl�ddl}��fdd�}|�d�||�t|���7}d�|��d�}t	|t
d	�d
�dS)Nzcoroutine 'z' was never awaited
rc3s8x2t�j�D]$\}}}��||�}||||fVqWdS)N)�reversed�	cr_originr )rr�funcnamer)�cororrr�extract�sz*_warn_unawaited_coroutine.<locals>.extractz-Coroutine created at (most recent call last)
r3r�)r
r�r#)rOr�r�	tracebackr:�format_list�listr��rstripr�RuntimeWarning)r��	msg_linesr�r�rr)r�rr�_warn_unawaited_coroutine�s

r�)rG�_defaultaction�
_onceregistryrrrKTr7cCstd7adS)Nru)r�rrrrrKsrKZgettotalrefcountrx)r
r8r:r5)r
r:)NN)N)NruN)NNNN).rPr�__all__rrrrr,r0r1rr@rrrErr!rMrUrQr[r\rrrtrr�objectr
r	r��	_warningsrGr�r�rKr�r�Z_warnings_defaultsrgr��warnoptions�hasattr�DeprecationWarning�PendingDeprecationWarning�
ImportWarning�ResourceWarningrrrr�<module>sh

;
"
	
5
EC 




Zerion Mini Shell 1.0