U
    KQh                     @   s   d Z ddlmZ ddlZddlZG dd deZG dd deZG dd	 d	eZ	G d
d deeZ
G dd deZdadddZdd ZdS )zN
A module that implements tooling to enable easy warnings about deprecations.
    )absolute_importNc                   @   s   e Zd ZdS )PipDeprecationWarningN__name__
__module____qualname__ r   r   4/tmp/pip-build-tlro1kwj/pip/pip/utils/deprecation.pyr   
   s   r   c                   @   s   e Zd ZdS )PendingNr   r   r   r   r	   r
      s   r
   c                   @   s   e Zd ZdS )RemovedInPip10WarningNr   r   r   r   r	   r      s   r   c                   @   s   e Zd ZdS )RemovedInPip11WarningNr   r   r   r   r	   r      s   r   c                   @   s   e Zd ZdS )Python26DeprecationWarningNr   r   r   r   r	   r      s   r   c                 C   sx   |d k	r$t d k	rtt | ||||| nPt|trbtd}d|  }t|trV|| qt|| nt | ||||| d S )Nzpip.deprecationszDEPRECATION: %s)_warnings_showwarning
issubclassr   logging	getLoggerr
   warningerror)messagecategoryfilenamelinenofilelineloggerlog_messager   r   r	   _showwarning$   s0         


     r   c                   C   s(   t jdtdd td kr$t jatt _d S )NdefaultT)append)warningssimplefilterr   r   showwarningr   r   r   r   r	   install_warning_loggerD   s    r"   )NN)__doc__
__future__r   r   r   Warningr   objectr
   r   r   r   r   r   r"   r   r   r   r	   <module>   s   
 