a
    /§»a
  ã                   @   s8   d dl Z d dlZG dd„ deƒZd
dd„Zddd	„ZdS )é    Nc                   @   s$   e Zd Zdd„ Zdd„ Zdd„ ZdS )ÚDeprecationWarningc                 C   s   || _ || _|| _d S ©N)ÚmsgÚpathÚlineno)Úselfr   r   r   © r   úI/home/yuhw/wc/pochoir/venv/lib/python3.9/site-packages/py/_log/warning.pyÚ__init__   s    zDeprecationWarning.__init__c                 C   s   d| j | jd | jf S )Nz	%s:%d: %sé   )r   r   r   ©r   r   r   r	   Ú__repr__   s    zDeprecationWarning.__repr__c                 C   s   | j S r   )r   r   r   r   r	   Ú__str__
   s    zDeprecationWarning.__str__N)Ú__name__Ú
__module__Ú__qualname__r
   r   r   r   r   r   r	   r      s   r   é   c                 C   sŠ   t |tƒrht d¡}d}|jj |¡dk}|rd|j}|j |¡dkrP|rT|}qhnd}|d7 }|j}q*d}d|| f }t||d |d� d S )Nr   éÿÿÿÿTz%s (since version %s))Ú
stacklevelÚfunction)	Ú
isinstanceÚstrÚsysÚ	_getframeÚf_codeÚco_filenameÚfindÚf_backÚwarn)Zstartversionr   r   r   ÚframeÚlevelÚfoundÚcor   r   r	   Ú_apiwarn   s     

r#   r   c              	   C   sH  |d ur*dd l }| |¡}tj |¡j}nXzt |¡}W n tyT   tj	}d}Y n0 |j
}|j}d|v rt|d }nd}| d¡}|rÈ| ¡ }	|	 d¡s¢|	 d¡r°|d d… }qþ|	 d	¡rþ| d	d
¡}n6|dkröztjd }W n tyô   d}Y n0 |sþ|}tj |¡}
t| |
|ƒ}dd l}|j|tt|jƒ|j|j	 di ¡d� d S )Nr   r   r   z<string>Ú__file__z.pycz.pyor   z	$py.classz.pyÚ__main__Z__warningsregistry__)ÚcategoryÚfilenamer   Úregistry)ÚinspectÚgetfileÚpyÚcodeZ
getrawcodeÚco_firstlinenor   r   Ú
ValueErrorÚ__dict__Ú	f_globalsÚf_linenoÚgetÚlowerÚendswithÚreplaceÚargvÚAttributeErrorr   Úlocalr   ÚwarningsÚwarn_explicitÚWarningr   r   Ú
setdefault)r   r   r   r)   r'   r   ZcallerÚglobalsÚmoduleZfnlr   Úwarningr9   r   r   r	   r   $   sL    





ÿýr   )r   N)r   N)r+   r   r   r#   r   r   r   r   r	   Ú<module>   s   

