Your IP : 18.227.140.251


Current Path : /lib64/python3.6/__pycache__/
Upload File :
Current File : //lib64/python3.6/__pycache__/warnings.cpython-36.opt-1.pyc

3


 \8H�
@sdZddlZddddddd	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�ZdZy0dd0lmZm Z m!Z!mZmZm"Z"e Z#e!Z$d1ZWn.e%k
�rfgZd2Z#iZ$d*a&d3d4�Z"YnXeej'�e�se(e)gZ*e*j+e,�xe*D]Z-e
d5e-d6��q�Wej.j/Z/e/d*k�r�d7Z0ne/�r�d2Z0nd5Z0e
e0e1d*d8�e2ed9��r�d:Z3nd5Z3e
e3e4d*d8�[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� /usr/lib64/python3.6/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|j|�Wntk
rJYnXdS)N)r�sys�stderr�_formatwarnmsg�write�OSError)rr�textrrrrsrcCsLd|j|j|jj|jf}|jdkr`yddl}|j|j|j�}Wqftk
r\d}d}YqfXn|j}|r~|j	�}|d|7}|j
dk	�rHyddl}|j|j
�}Wntk
r�d}YnX|dk	�rH|d7}xx|D]p}|d|j|jf7}y$|dk	�r
|j|j|j�}nd}Wntk
�r*d}YnX|r�|j	�}|d|7}q�W|S)Nz%s:%s: %s: %s
rz  %s
z.Object allocated at (most recent call first):
z  File "%s", lineno %s
z    %s
)
rrr
�__name__rr�	linecache�getline�	Exception�strip�source�tracemalloc�get_object_traceback)r�srrr"�tb�framerrrr#sF






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�_showwarnmsgUsr,cCsJyt}Wntk
rYn&X|tk	rB||j|j|j|j|jd�St|�S)z.Function to format a warning the standard way.)r)	rr'�_formatwarning_origrr
rrrr)r�fwrrrrjs
r�FcCs0ddl}t||j||j�||j|�||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�_add_filter�compile�I)�actionrr
�modulerr0r1rrrrws	cCst|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
    N)r0)r2)r5r
rr0rrrr�scGsR|s6ytj|�Wntk
r&YnXtjd|�n|tkrHtj|�t�dS)Nr)�filters�remove�
ValueError�insertr0�_filters_mutated)r0�itemrrrr2�s
r2cCsgtdd�<t�dS)zAClear the list of warning filters, so that no filters are active.N)r7r;rrrrr�sc@seZdZdZdS)�_OptionErrorz,Exception used by option processing helpers.N)r�
__module__�__qualname__�__doc__rrrrr=�sr=cCsRxL|D]D}yt|�Wqtk
rH}ztd|tjd�WYdd}~XqXqWdS)NzInvalid -W option ignored:)r)�
_setoptionr=�printrr)�args�argrrrr�_processoptions�s

rEcCs�ddl}|jd�}t|�dkr,td|f��xt|�dkrF|jd�q.Wdd�|D�\}}}}}t|�}|j|�}t|�}|j|�}|r�|d}|r�yt|�}|dkr�t	�Wq�t	t
fk
r�td	|f��Yq�Xnd}t|||||�dS)
Nr�:�ztoo many fields (max 5): %rr/cSsg|]}|j��qSr)r )�.0r$rrr�
<listcomp>�sz_setoption.<locals>.<listcomp>�$zinvalid lineno %r)r1�split�lenr=r0�
_getaction�escape�_getcategory�intr9�
OverflowErrorr)rDr1�partsr5rr
r6rrrrrA�s.


rAcCsB|sdS|dkrdSxd	D]}|j|�r|SqWtd|f��dS)
N�default�all�always�ignorer6�once�errorzinvalid action: %r)rSrUrVr6rWrX)�
startswithr=)r5�arrrrM�s

rMcCs�ddl}|stS|jd|�rNyt|�}Wq�tk
rJtd|f��Yq�Xn�|jd�}|d|�}||dd�}yt|dd|g�}Wn"tk
r�td|f��YnXyt	||�}Wn"t
k
r�td|f��YnXt|t�s�td|f��|S)Nrz^[a-zA-Z0-9_]+$zunknown warning category: %r�.�zinvalid module name: %rzinvalid warning category: %r)r1�Warning�match�evalr'r=�rfind�
__import__�ImportError�getattr�AttributeError�
issubclass)r
r1�cat�ir6�klass�mrrrrO�s,

rOcCs|jj}d|kod|kS)zFSignal whether the frame is an internal CPython implementation detail.�	importlib�
_bootstrap)�f_code�co_filename)r&rrrr�_is_internal_frame�srncCs&|j}x|dk	r t|�r |j}qW|S)z;Find the next frame that doesn't involve CPython internals.N)�f_backrn)r&rrr�_next_external_frames
rpr\cCsvt|t�r|j}|dkrt}t|t�o.t|t�sDtdjt|�j���yZ|dks\t	t
jd��rht
j|�}n4t
jd�}x(t|d�D]}t
|�}|dkr�t�q�WWntk
r�t
j}d}YnX|j}|j}d|kr�|d}nd}|jd�}	|	�r|	j�}
|
jd��rP|	dd�}	n>|dk�rFyt
jd	}	Wntk
�rDd}	YnX|	�sP|}	|jd
i�}t|||	|||||�dS)z:Issue a warning, or maybe ignore it or raise an exception.Nz/category must be a Warning subclass, not '{:s}'r\rz<string>�__file__z.pyc�__main__rZ__warningregistry__���)�
isinstancer]�	__class__�UserWarning�typerer*�formatrrnr�	_getframe�rangerpr9�__dict__�	f_globals�f_lineno�get�lower�endswith�argvrd�
setdefaultr)rr
�
stacklevelr!r&�x�globalsrr6rZfnl�registryrrrr
sL






cCs�t|�}|dkr8|pd}|dd�j�dkr8|dd�}|dkrDi}|jdd�tkrd|j�t|d<t|t�r~t|�}|j}n|}||�}|||f}	|j|	�r�dSx^t	D]R}
|
\}}}
}}|dks�|j
|�r�t||
�r�|dks�|j
|�r�|dks�||kr�Pq�Wt}|dk�rd||	<dSddl
}|j||�|dk�r:|�|d	k�rnd||	<||f}tj|��rddSdt|<nf|d
k�rznZ|dk�r�d||	<||df}|j|��r�dSd||<n$|dk�r�d||	<ntd
||
f��t|||||�}t|�dS)Nz	<unknown>�z.py�versionrrVr\rXrWrUr6rSz1Unrecognized action (%r) in warnings.filters:
 %s���r�)rPrr~�_filters_version�clearrtr]�strrur7r^re�
defaultactionr�getlines�onceregistry�RuntimeErrorr
r,)rr
rrr6r��module_globalsr!r�keyr<r5rrf�mod�lnrZoncekeyZaltkeyrrrrAsl














c@s"eZdZd
Zdd	d
�Zdd�ZdS)r
rr
rrrrr!Nc
Cs:t�}x|jD]}	t||	||	�qW|r0|jnd|_dS)N)�locals�_WARNING_DETAILS�setattrr�_category_name)
�selfrr
rrrrr!�local_values�attrrrr�__init__�szWarningMessage.__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__)rr
rrrrr!)NNN)rr>r?r�r�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)�recordr6cCs(||_|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�r6rrrr��szcatch_warnings.__init__cCsPg}|jr|jd�|jtjdk	r4|jd|j�t|�j}d|dj|�fS)Nzrecord=Truer�z	module=%rz%s(%s)z, )r�r0r�rr�rwr�join)r�rC�namerrr�__repr__�s

zcatch_warnings.__repr__cCs~|jrtd|��d|_|jj|_|jdd�|j_|jj�|jj|_|jj|_|j	rvg}|j
|j_|jj|j_|SdSdS)NzCannot enter %r twiceT)r�r�r�r7�_filtersr;r�_showwarningrr�r0r()r��logrrr�	__enter__�s




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


zcatch_warnings.__exit__)rr>r?r@r�r�r�r�rrrrr	�s
	)r7�_defaultaction�
_onceregistryrrr;TrScCstd7adS)Nr\)r�rrrrr;�sr;rV)r
rX)r
r0�gettotalrefcountrU)NN)N)Nr\N)NNNN)5r@r�__all__rrrrr(r,r-rr]rrr2rrr=rErArMrOrnrprr�objectr
r	Z_warnings_defaults�	_warningsr7r�r�r;r�r�rbr��warnoptions�
ImportWarning�PendingDeprecationWarningZsilencer0�DeprecationWarning�cls�flags�
bytes_warningZbytes_action�BytesWarning�hasattrZresource_action�ResourceWarningrrrr�<module>sv

0

	
5
FJ 





?>