a
´ièL ã @ sÌ d Z ddlZg d¢Zd=dd„Zd>dd„Zdd „ Zd
d„ ZeZdd
„ ZeZ dd„ Z
dedddfdd„Zeddfdd„Z
dd„ Zdd„ ZG dd„ deƒZdd„ Zdd„ Zd d!„ Zd"d#„ Zd$d%„ Zd&d'„ Zd?d)d*„Zd@d+d,„ZG d-d.„ d.eƒZG d/d0„ d0eƒZd1d2„ Zz0dd3lmZm Z m!Z!mZmZm"Z" e Z#e!Z$d4Z%W n0 e&�y` g Zd5Z#i Z$d(a'd6d7„ Z"dZ%Y n0 eej(ƒ e%�sÆe)ed8ƒ�sÆed5e*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_warningsc C s t | |||||ƒ}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 ú /usr/lib64/python3.9/warnings.pyr
s r c C s t | |||d|ƒ}t|ƒS )ú.Function to format a warning the standard way.N)r Ú_formatwarnmsg_impl)r
r r r r r r r r r s r c C sN | j }|d u r tj}|d u r d S t| ƒ}z| |¡ W n tyH Y n0 d S ©N)r ÚsysÚstderrÚ_formatwarnmsgÚwriteÚOSError)r r Útextr r r r s r c C s” | j j}| j› d| j› d|› d| j› d�}| jd u rnzdd l}| | j| j¡}W qt tyj d }d }Y qt0 n| j}|rŒ| ¡ }|d| 7 }| j
d u�r�zdd l}W n ty¾ d}d }Y n20 | ¡ }z|
| j
¡}W n tyî d }Y n0 |d u�r||d7 }|D ]r}|d|j|jf 7 }z$|d u�r<| |j|j¡}nd }W n t�yZ d }Y n0 |�r| ¡ }|d | 7 }�qn|�s�||› d
�7 }|S )Nú:z: Ú
r z %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__r r r
r Ú linecacheÚgetlineÚ ExceptionÚstripÚsourceÚtracemallocÚ
is_tracingÚget_object_traceback) r r Úsr" r r' ÚtracingÚtbÚframer r r r # sT "
ÿ
r c C sb zt }W n ty Y n<0 |turVt|ƒs4tdƒ‚|| j| j| j| j| j | j
ƒ dS t| ƒ dS )r
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 Ú_showwarnmsg` s ÿr3 c C sF zt }W n ty Y n$0 |tur>|| j| j| j| j| jƒS t| ƒS )r ) r r. Ú_formatwarning_origr
r r r r r )r Úfwr r r r u s
ÿr Ú Fc C sÌ | dv sJ d| f ƒ‚t |tƒs(J dƒ‚t |tƒs:J dƒ‚t|tƒsLJ dƒ‚t |tƒs^J dƒ‚t |tƒrp|dksxJ dƒ‚|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Ú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
r r<