
0c@_                 @   s~   d  d l  m Z d  d l m Z d  d l m Z e rd d  d l m Z m Z m	 Z	 e	 d d d Z
 Gd d	   d	 e  Z d
 S)    )contextmanager)	ExitStack)MYPY_CHECK_RUNNING)IteratorContextManagerTypeVar_TZ	covariantTc                   s@   e  Z d  Z   f d d   Z e d d    Z d d   Z   S)CommandContextMixInc                s,   t  t |   j   d |  _ t   |  _ d  S)NF)superr	   __init___in_main_contextr   _main_context)self)	__class__ @/tmp/pip-build-jynh7p1z/pip/pip/_internal/cli/command_context.pyr      s    	zCommandContextMixIn.__init__c             c   sD   |  j  s t  d |  _  z |  j 
 d  VWd  QRXWd  d |  _  Xd  S)NTF)r   AssertionErrorr   )r   r   r   r   main_context   s    	
z CommandContextMixIn.main_contextc             C   s   |  j  s t  |  j j |  S)N)r   r   r   enter_context)r   Zcontext_providerr   r   r   r       s    z!CommandContextMixIn.enter_context)__name__
__module____qualname__r   r   r   r   r   r   )r   r   r	      s   r	   N)
contextlibr   Zpip._vendor.contextlib2r   Zpip._internal.utils.typingr   Ztypingr   r   r   r   objectr	   r   r   r   r   <module>   s   