U
    @{?^F  ã                   @   sP   g Z eZzd dlmZ W n2 ek
rJ   d dlZd dlZG dd„ dƒZY nX d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f |Ž| _ d S ©N)ÚnameÚtempfileZmkdtemp)ÚselfÚkwargs© r   ú7/usr/lib/python3/dist-packages/setuptools/py31compat.pyÚ__init__   s    zTemporaryDirectory.__init__c                 C   s   | j S r   )r   )r   r   r   r	   Ú	__enter__   s    zTemporaryDirectory.__enter__c                 C   s2   zt  | jd¡ W n tk
r&   Y nX d | _d S )NT)ÚshutilZ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   