
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
3

  \8H  ã               @   s  d Z ddlZddddddd	d
gZd;dd„Zd<dd„Zdd„ Zdd„ ZeZdd„ ZeZ	dd„ Z
dedddfdd„Zeddfdd„Zdd„ Zdd	„ ZG dd„ deƒZdd„ Zd d!„ Zd"d#„ Zd$d%„ Zd&d'„ Zd(d)„ Zd=d+d„Zd>d,d„ZG d-d.„ d.eƒZG d/d
„ d
eƒZdZy0dd0lmZm Z m!Z!mZmZm"Z" e Z#e!Z$d1ZW n. e%k
�rf   g Zd2Z#i Z$d*a&d3d4„ Z"Y nX eej'ƒ e�s e(e)gZ*e*j+e,ƒ xe*D ]Z-ed5e-d6� �q�W ej.j/Z/e/d*k�r¾d7Z0ne/�rÊd2Z0nd5Z0ee0e1d*d8� e2ed9ƒ�rîd:Z3nd5Z3ee3e4d*d8� [dS )?z&Python part of the warnings subsystem.é    NÚwarnÚwarn_explicitÚshowwarningÚformatwarningÚfilterwarningsÚsimplefilterÚresetwarningsÚcatch_warningsc             C   s   t | |||||ƒ}t|ƒ dS )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   
   s    c             C   s   t | |||d|ƒ}t|ƒS )z.Function to format a warning the standard way.N)r
   Ú_formatwarnmsg_impl)r   r   r   r   r   r   r   r   r   r      s    c             C   sP   | j }|d kr tj}|d kr d S t| ƒ}y|j|ƒ W n tk
rJ   Y nX d S )N)r   ÚsysÚstderrÚ_formatwarnmsgÚwriteÚOSError)r   r   Útextr   r   r   r      s    r   c             C   sL  d| j | j| jj| jf }| jd kr`ydd l}|j| j | jƒ}W qf tk
r\   d }d }Y qfX n| j}|r~|j	ƒ }|d| 7 }| j
d k	�rHydd l}|j| j
ƒ}W n tk
rº   d }Y nX |d k	�rH|d7 }xx|D ]p}|d|j |jf 7 }y$|d k	�r
|j|j |jƒ}nd }W n tk
�r*   d }Y nX |rÔ|j	ƒ }|d| 7 }qÔW |S )Nz%s:%s: %s: %s
r   z  %s
z.Object allocated at (most recent call first):
z  File "%s", lineno %s
z    %s
)r   r   r   Ú__name__r   r   Ú	linecacheÚgetlineÚ	ExceptionÚstripÚsourceÚtracemallocÚget_object_traceback)r   Úsr   r   r"   ÚtbÚframer   r   r   r   #   sF    






r   c             C   sd   yt }W n tk
r   Y n<X |tk	rXt|ƒs6tdƒ‚|| j| j| j| j| j	| j
ƒ dS t| ƒ dS )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   r   r   r   r   r   )r   Úswr   r   r   Ú_showwarnmsgU   s    r,   c             C   sJ   yt }W n tk
r   Y n&X |tk	rB|| j| j| j| j| jd�S t| ƒS )z.Function to format a warning the standard way.)r   )	r   r'   Ú_formatwarning_origr   r   r   r   r   r   )r   Úfwr   r   r   r   j   s    
r   Ú Fc             C   s0   ddl }t| |j||jƒ||j|ƒ||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
    r   N)Úappend)ÚreÚ_add_filterÚcompileÚI)Úactionr   r   Úmoduler   r0   r1   r   r   r   r   w   s    	c             C   s   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
    N)r0   )r2   )r5   r   r   r0   r   r   r   r   �   s    c             G   sR   | s6yt j|ƒ W n tk
r&   Y nX t jd|ƒ n|t krHt j|ƒ tƒ  d S )Nr   )ÚfiltersÚremoveÚ
ValueErrorÚinsertr0   Ú_filters_mutated)r0   Úitemr   r   r   r2   Ÿ   s    
r2   c               C   s   g t dd…< tƒ  dS )zAClear the list of warning filters, so that no filters are active.N)r7   r;   r   r   r   r   r   ­   s    c               @   s   e Zd ZdZdS )Ú_OptionErrorz,Exception used by option processing helpers.N)r   Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r=   ²   s   r=   c             C   sR   xL| D ]D}yt |ƒ W q tk
rH } ztd|tjd� W Y d d }~X qX qW d S )NzInvalid -W option ignored:)r   )Ú
_setoptionr=   Úprintr   r   )ÚargsÚargr   r   r   r   Ú_processoptions·   s
    
rE   c             C   sî   dd l }| jdƒ}t|ƒdkr,td| f ƒ‚xt|ƒdk rF|jdƒ q.W dd„ |D ƒ\}}}}}t|ƒ}|j|ƒ}t|ƒ}|j|ƒ}|r�|d }|rÖyt|ƒ}|dk rªt	‚W qÚ t	t
fk
rÒ   td	|f ƒ‚Y qÚX nd}t|||||ƒ d S )
Nr   ú:é   ztoo many fields (max 5): %rr/   c             S   s   g | ]}|j ƒ ‘qS r   )r    )Ú.0r$   r   r   r   ú
<listcomp>Æ   s   z_setoption.<locals>.<listcomp>ú$zinvalid lineno %r)r1   ÚsplitÚlenr=   r0   Ú
_getactionÚescapeÚ_getcategoryÚintr9   ÚOverflowErrorr   )rD   r1   Úpartsr5   r   r   r6   r   r   r   r   rA   ¿   s.    


rA   c             C   sB   | sdS | dkrdS xd	D ]}|j | ƒr|S qW td| f ƒ‚d S )
NÚdefaultÚallÚalwaysÚignorer6   ÚonceÚerrorzinvalid action: %r)rS   rU   rV   r6   rW   rX   )Ú
startswithr=   )r5   Úar   r   r   rM   Ú   s     

rM   c             C   sú   dd l }| stS |jd| ƒrNyt| ƒ}W qÞ tk
rJ   td| f ƒ‚Y qÞX n�| jdƒ}| d |… }| |d d … }yt|d d |gƒ}W n" tk
rª   td|f ƒ‚Y nX yt	||ƒ}W n" t
k
rÜ   td| f ƒ‚Y nX t|tƒsötd| f ƒ‚|S )Nr   z^[a-zA-Z0-9_]+$zunknown warning category: %rÚ.é   zinvalid module name: %rzinvalid warning category: %r)r1   ÚWarningÚmatchÚevalr'   r=   ÚrfindÚ
__import__ÚImportErrorÚgetattrÚAttributeErrorÚ
issubclass)r   r1   ÚcatÚir6   ÚklassÚmr   r   r   rO   ä   s,    

rO   c             C   s   | j j}d|kod|kS )zFSignal whether the frame is an internal CPython implementation detail.Ú	importlibÚ
_bootstrap)Úf_codeÚco_filename)r&   r   r   r   r   Ú_is_internal_frameþ   s    rn   c             C   s&   | j } x| dk	r t| ƒr | j } qW | S )z;Find the next frame that doesn't involve CPython internals.N)Úf_backrn   )r&   r   r   r   Ú_next_external_frame  s    
rp   r\   c             C   sv  t | tƒr| j}|dkrt}t |tƒo.t|tƒsDtdjt|ƒjƒƒ‚yZ|dks\t	t
jdƒƒrht
j|ƒ}n4t
jdƒ}x(t|d ƒD ]}t|ƒ}|dkr€t‚q€W W n tk
r¼   t
j}d}Y nX |j}|j}d|krÜ|d }nd}|jdƒ}	|	�r|	jƒ }
|
jdƒ�rP|	dd… }	n>|dk�rFyt
jd	 }	W n tk
�rD   d}	Y nX |	�sP|}	|jd
i ƒ}t| ||	|||||ƒ dS )z:Issue a warning, or maybe ignore it or raise an exception.Nz/category must be a Warning subclass, not '{:s}'r\   r   z<string>Ú__file__z.pycÚ__main__r   Z__warningregistry__éÿÿÿÿ)Ú
isinstancer]   Ú	__class__ÚUserWarningÚtypere   r*   Úformatr   rn   r   Ú	_getframeÚrangerp   r9   Ú__dict__Ú	f_globalsÚf_linenoÚgetÚlowerÚendswithÚargvrd   Ú
setdefaultr   )r   r   Ú
stacklevelr!   r&   ÚxÚglobalsr   r6   r   ZfnlÚregistryr   r   r   r     sL    






c             C   sð  t |ƒ}|d kr8|pd}|dd … jƒ dkr8|d d… }|d krDi }|jddƒtkrd|jƒ  t|d< t| tƒr~t| ƒ}| j}n| }|| ƒ} |||f}	|j|	ƒr¢d S x^t	D ]R}
|
\}}}}}|d ksÌ|j
|ƒr¨t||ƒr¨|d ksè|j
|ƒr¨|dksø||kr¨P q¨W t}|dk�rd||	< d S dd l}|j||ƒ |dk�r:| ‚|d	k�rnd||	< ||f}tj|ƒ�rdd S dt|< nf|d
k�rznZ|dk�r°d||	< ||df}|j|ƒ�r¦d S d||< n$|dk�rÄd||	< ntd||
f ƒ‚t| ||||ƒ}t|ƒ d S )Nz	<unknown>é   z.pyÚversionr   rV   r\   rX   rW   rU   r6   rS   z1Unrecognized action (%r) in warnings.filters:
 %séýÿÿÿr‰   )rP   r   r~   Ú_filters_versionÚclearrt   r]   Ústrru   r7   r^   re   Údefaultactionr   ÚgetlinesÚonceregistryÚRuntimeErrorr
   r,   )r   r   r   r   r6   r†   Úmodule_globalsr!   r   Úkeyr<   r5   r   rf   ÚmodÚlnr   ZoncekeyZaltkeyr   r   r   r   A  sl    














c               @   s"   e Zd ZdZdd	d
„Zdd„ ZdS )r
   r   r   r   r   r   r   r!   Nc       
      C   s:   t ƒ }x| jD ]}	t| |	||	 ƒ qW |r0|jnd | _d S )N)ÚlocalsÚ_WARNING_DETAILSÚsetattrr   Ú_category_name)
Úselfr   r   r   r   r   r   r!   Úlocal_valuesÚattrr   r   r   Ú__init__Ž  s    zWarningMessage.__init__c             C   s   d| j | j| j| j| jf S )NzD{message : %r, category : %r, filename : %r, lineno : %s, line : %r})r   r˜   r   r   r   )r™   r   r   r   Ú__str__•  s    zWarningMessage.__str__)r   r   r   r   r   r   r!   )NNN)r   r>   r?   r–   rœ   r�   r   r   r   r   r
   ‰  s
     
r
   c               @   s8   e Zd ZdZdddœdd„Zdd„ Zd	d
„ Zdd„ ZdS )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)Úrecordr6   c            C   s(   || _ |dkrtjd n|| _d| _dS )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ž   r6   r   r   r   rœ   ¬  s    zcatch_warnings.__init__c             C   sP   g }| j r|jdƒ | jtjd k	r4|jd| j ƒ t| ƒj}d|dj|ƒf S )Nzrecord=TruerŸ   z	module=%rz%s(%s)z, )r    r0   r¢   r   r¡   rw   r   Újoin)r™   rC   Únamer   r   r   Ú__repr__¸  s    

zcatch_warnings.__repr__c             C   s~   | j rtd|  ƒ‚d| _ | jj| _| jd d … | j_| jjƒ  | jj| _| jj| _| j	rvg }|j
| j_| jj| j_|S d S d S )NzCannot enter %r twiceT)r£   r�   r¢   r7   Ú_filtersr;   r   Ú_showwarningr   r    r0   r(   )r™   Úlogr   r   r   Ú	__enter__Á  s    




zcatch_warnings.__enter__c             G   s>   | j std|  ƒ‚| j| j_| jjƒ  | j| j_| j| j_d S )Nz%Cannot exit %r without entering first)	r£   r�   r§   r¢   r7   r;   r¨   r   r   )r™   Úexc_infor   r   r   Ú__exit__Ô  s    


zcatch_warnings.__exit__)r   r>   r?   r@   rœ   r¦   rª   r¬   r   r   r   r   r	   ›  s
   	)r7   Ú_defaultactionÚ_onceregistryr   r   r;   TrS   c               C   s   t d7 a d S )Nr\   )rŠ   r   r   r   r   r;   ó  s    r;   rV   )r   rX   )r   r0   ÚgettotalrefcountrU   )NN)N)Nr\   N)NNNN)5r@   r   Ú__all__r   r   r   r   r(   r,   r-   r   r]   r   r   r2   r   r   r=   rE   rA   rM   rO   rn   rp   r   r   Úobjectr
   r	   Z_warnings_defaultsÚ	_warningsr7   r­   r®   r;   r�   r�   rb   rŠ   ÚwarnoptionsÚImportWarningÚPendingDeprecationWarningZsilencer0   ÚDeprecationWarningÚclsÚflagsÚbytes_warningZbytes_actionÚBytesWarningÚhasattrZresource_actionÚResourceWarningr   r   r   r   Ú<module>   sv   

0
	
5 
FJ 



