
(hF                 @   sd   g  Z  e Z y d  d l m Z Wn= e k
 r_ d  d l Z d  d l Z Gd d   d  Z Yn Xd S)    )TemporaryDirectoryNc               @   s:   e  Z d  Z d Z d d   Z d d   Z d d   Z d S)	r   z
        Very simple temporary directory context manager.
        Will try to delete afterward, but will also ignore OS and similar
        errors on deletion.
        c             K   s   d  |  _  t j |   |  _  d  S)N)nametempfilemkdtemp)selfkwargs r   ;/tmp/pip-build-kmztzv_d/setuptools/setuptools/py31compat.py__init__   s    	zTemporaryDirectory.__init__c             C   s   |  j  S)N)r   )r   r   r   r	   	__enter__   s    zTemporaryDirectory.__enter__c             C   s9   y t  j |  j d  Wn t k
 r+ Yn Xd  |  _ d  S)NT)shutilrmtreer   OSError)r   exctypeZexcvalueZexctracer   r   r	   __exit__   s
    zTemporaryDirectory.__exit__N)__name__
__module____qualname____doc__r
   r   r   r   r   r   r	   r      s   r   )__all__typeZ__metaclass__r   r   ImportErrorr   r   r   r   r	   <module>   s   