AlkantarClanX12

Your IP : 13.58.200.16


Current Path : /proc/self/root/opt/alt/python35/lib64/python3.5/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python35/lib64/python3.5/__pycache__/warnings.cpython-35.pyc



��Yf�=�@s�dZddlZddddddd	d
gZdddd�Zddd�Zd
ed
dddd�Zedddd�Zdd�Zdd	�Z	Gdd�de
�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd d!�Zdd"d#d�Zdddd$d�ZGd%d&�d&e�ZGd'd
�d
e�ZdZyDdd(lmZmZmZmZmZmZeZeZd)ZWn6ek
r�gZd*ZiZd"a d+d,�ZYnXeej!�es�e"e#gZ$e$j%e&�xe$D]Z'ed-d.e'�qWej(j)Z)e)d"kr;d/Z*ne)rJd*Z*nd-Z*ee*d.e+d0d"�e,ed1�r~d2Z-nd-Z-ee-d.e.d0d"�[dS)3z&Python part of the warnings subsystem.�N�warn�
warn_explicit�showwarning�
formatwarning�filterwarnings�simplefilter�
resetwarnings�catch_warningsc
Csa|dkr%tj}|dkr%dSy#|jt|||||��Wntk
r\YnXdS)z7Hook to write a warning to a file; replace if you like.N)�sys�stderr�writer�OSError)�message�category�filename�lineno�file�line�r�-/opt/alt/python35/lib64/python3.5/warnings.pyr
s	#
cCs�d|||j|f}|dkrby"ddl}|j||�}Wntk
rad}YnX|r�|j�}|d|7}|S)z.Function to format a warning the standard way.z%s:%s: %s: %s
Nrz  %s
)�__name__�	linecache�getline�	Exception�strip)rrrrr�srrrrrs
�FcCs�ddl}|dks+td	|f��t|t�sFtd
��t|t�satd��t|t�s|td��t|t�s�td
��t|t�r�|dks�td��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�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 stringzlineno must be an int >= 0�append)rrrr r!r")�re�AssertionError�
isinstance�str�type�
issubclass�Warning�int�_add_filter�compile�I)�actionrrr!rr#r$rrrr&s	cCsf|dkstd|f��t|t�r:|dksFtd	��t|d
|d
|d|�d
S)
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
    rrrr r!r"zinvalid action: %rrzlineno must be an int >= 0Nr#)rrrr r!r")r%r&r+r,)r/rrr#rrrr>s

	cGsc|s?ytj|�Wntk
r+YnXtjd|�n|tkrXtj|�t�dS)Nr)�filters�remove�
ValueError�insertr#�_filters_mutated)r#�itemrrrr,Ns

r,cCsgtdd�<t�dS)zAClear the list of warning filters, so that no filters are active.N)r0r4rrrrr\sc@seZdZdZdS)�_OptionErrorz,Exception used by option processing helpers.N)r�
__module__�__qualname__�__doc__rrrrr6asr6cCsaxZ|D]R}yt|�Wqtk
rX}ztd|dtj�WYdd}~XqXqWdS)NzInvalid -W option ignored:r)�
_setoptionr6�printr
r)�args�arg�msgrrr�_processoptionsfs

r?cCsGddl}|jd�}t|�dkr@td|f��x#t|�dkre|jd�qCWdd�|D�\}}}}}t|�}|j|�}t|�}|j|�}|r�|d}|r'y"t|�}|dkr�t	�Wq-t	t
fk
r#td	|f��Yq-Xnd}t|||||�dS)
Nr�:�ztoo many fields (max 5): %rrcSsg|]}|j��qSr)r)�.0rrrr�
<listcomp>us	z_setoption.<locals>.<listcomp>�$zinvalid lineno %r)r$�split�lenr6r#�
_getaction�escape�_getcategoryr+r2�
OverflowErrorr)r=r$�partsr/rrr!rrrrr:ns.	

r:cCsU|s
dS|dkrdSx!d	D]}|j|�r!|Sq!Wtd|f��dS)
Nr �allrrr!r"rzinvalid action: %r)r rrr!r"r)�
startswithr6)r/�arrrrG�s
rGcCs;ddl}|stS|jd|�rcyt|�}Wqtk
r_td|f��YqXn�|jd�}|d|�}||dd�}yt|dd|g�}Wn%tk
r�td|f��YnXyt	||�}Wn%t
k
rtd|f��YnXt|t�s7td|f��|S)Nrz^[a-zA-Z0-9_]+$zunknown warning category: %r�.�zinvalid module name: %rzinvalid warning category: %r)r$r*�match�eval�	NameErrorr6�rfind�
__import__�ImportError�getattr�AttributeErrorr))rr$�cat�ir!�klass�mrrrrI�s,


rIcCs"|jj}d|ko!d|kS)zFSignal whether the frame is an internal CPython implementation detail.�	importlib�
_bootstrap)�f_code�co_filename)�framerrrr�_is_internal_frame�srbcCs5|j}x%|dk	r0t|�r0|j}qW|S)z;Find the next frame that doesn't involve CPython internals.N)�f_backrb)rarrr�_next_external_frame�s	
rdrPcCs�t|t�r|j}|dkr*t}t|t�oEt|t�sftdjt|�j���y|dks�t	t
jd��r�t
j|�}nHt
jd�}x6t|d�D]$}t
|�}|dkr�t�q�WWn!tk
rt
j}d}YnX|j}|j}d|kr4|d}nd}|jd�}|r}|j�}	|	jd�r�|dd�}nD|dkr�yt
jd	}Wntk
r�d}YnX|s�|}|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}'rPrz<string>�__file__z.pyc�__main__rZ__warningregistry__���)r&r*�	__class__�UserWarningr(r)�	TypeError�formatrrbr
�	_getframe�rangerdr2�__dict__�	f_globals�f_lineno�get�lower�endswith�argvrX�
setdefaultr)rr�
stacklevelra�x�globalsrr!rZfnl�registryrrrr�sL		!
			

cCs�t|�}|dkrP|p!d}|dd�j�dkrP|dd�}|dkrbi}|jdd�tkr�|j�t|d<t|t�r�t|�}|j}n|}||�}|||f}|j|�r�dSx�t	D]y}	|	\}
}}}
}|dks&|j
|�r�t||�r�|
dksP|
j
|�r�|dksh||kr�Pq�Wt}
|
dkr�d||<dSddl
}|j||�|
dkr�|�|
d	kr�d||<||f}tj|�r�dSdt|<n�|
d
krnt|
dkrQd||<||df}|j|�rDdSd||<n/|
dkrjd||<ntd
|
|	f��tt�s�td��t||||�dS)Nz	<unknown>�z.py�versionrrrPrr"rr!r z1Unrecognized action (%r) in warnings.filters:
 %sz:warnings.showwarning() must be set to a function or method���r|)r+rrrq�_filters_version�clearr&r*r'rhr0rQr)�
defaultactionr�getlines�onceregistry�RuntimeError�callablerrj)rrrrr!ry�module_globals�text�keyr5r/r>rY�mod�lnrZoncekeyZaltkeyrrrr�sn








c@s:eZdZdZd
Zddd	d
�Zdd�ZdS)�WarningMessagez0Holds the result of a single showwarning() call.rrrrrrNc	CsMt�}x%|jD]}t||||�qW|r@|jnd|_dS)N)�locals�_WARNING_DETAILS�setattrr�_category_name)	�selfrrrrrr�local_values�attrrrr�__init__@s	zWarningMessage.__init__cCs&d|j|j|j|j|jfS)NzD{message : %r, category : %r, filename : %r, lineno : %s, line : %r})rr�rrr)r�rrr�__str__GszWarningMessage.__str__)rrrrrr)rr7r8r9r�r�r�rrrrr�9sr�c@sReZdZdZdddddd�Zdd	�Zd
d�Zdd
�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.

    �recordFr!NcCs8||_|dkr"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__cCslg}|jr|jd�|jtjdk	rF|jd|j�t|�j}d|dj|�fS)Nzrecord=Truer�z	module=%rz%s(%s)z, )r�r#r�r
r�r(r�join)r�r<�namerrr�__repr__js	
zcatch_warnings.__repr__cs�|jrtd|��d|_|jj|_|jdd�|j_|jj�|jj|_|jr�g��fdd�}||j_�SdSdS)NzCannot enter %r twiceTcs�jt||��dS)N)r#r�)r<�kwargs)�logrrr}sz-catch_warnings.__enter__.<locals>.showwarning)	r�r�r�r0�_filtersr4r�_showwarningr�)r�rr)r�r�	__enter__ss		
	zcatch_warnings.__enter__cGsH|jstd|��|j|j_|jj�|j|j_dS)Nz%Cannot exit %r without entering first)r�r�r�r�r0r4r�r)r��exc_inforrr�__exit__�s
	
zcatch_warnings.__exit__)rr7r8r9r�r�r�r�rrrrr	Ms
	)r0�_defaultaction�
_onceregistryrrr4Tr cCstd7adS)NrP)r}rrrrr4�sr4rrrr#�gettotalrefcountr)/r9r
�__all__rrr*rrr,rrr6r?r:rGrIrbrdrr�objectr�r	Z_warnings_defaults�	_warningsr0r�r�r4rr�rVr}�warnoptions�
ImportWarning�PendingDeprecationWarningZsilencer#�DeprecationWarning�cls�flags�
bytes_warningZbytes_action�BytesWarning�hasattrZresource_action�ResourceWarningrrrr�<module>sh		
	5HG.