B
    `
                 @   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   W/home/kop/projects/devel/pgwui/test_venv/lib/python3.7/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 )N)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rltd}d}|jj|dk}x@|rf|j}|j|dkrR|rV|}P nd}|d7 }|j}q,W 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   sN  |d k	r*dd l }||}tj|j}nZyt|}W n tk
rV   tj	}d}Y nX |j
}|j}d|krv|d }nd}|d}|r| }	|	ds|	dr|d d }n|	d	r|d	d
}n:|dkrytjd }W n tk
r   d}Y nX |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   warningr7   r   r   r   r   $   sH    





r   )r   N)r
   N)r)   r   r   r!   r   r   r   r   r   <module>   s   

