B
    '\                 @   s   d dl mZmZmZmZ d dlZd dlmZ ddl	T e
Z
e
rFd dlZnd dlZeZddlmZ eZG dd deZed	ejd
 dS )    )absolute_importdivisionprint_functionunicode_literalsN)mkdtemp   )*)lchmodc               @   sP   e Zd ZdZdZdZdddZdd	 Zd
d Zde	fddZ
dd Zdd ZdS )TemporaryDirectorya+  Create and return a temporary directory.  This has the same
    behavior as mkdtemp but can be used as a context manager.  For
    example:

        with TemporaryDirectory() as tmpdir:
            ...

    Upon exiting the context, the directory and everything contained
    in it are removed.
    NF tmpc             C   s   t |||| _d S )N)r   name)selfsuffixprefixdir r   +lib/python3.7/site-packages/conda/compat.py__init__*   s    zTemporaryDirectory.__init__c             C   s   d | jj| jS )Nz	<{} {!r}>)format	__class____name__r   )r   r   r   r   __repr__-   s    zTemporaryDirectory.__repr__c             C   s   | j S )N)r   )r   r   r   r   	__enter__0   s    zTemporaryDirectory.__enter__c          
   C   sr   ddl m} | jrn| jsny|| j W n@ ttfk
rf } zdd|f krL || j W d d }~X Y nX d| _d S )Nr   )rm_rfNonez%sT)Zgateways.disk.deleter   r   _closed	TypeErrorAttributeError)r   _warn	_warningsZ_rm_rfexr   r   r   cleanup3   s    zTemporaryDirectory.cleanupc             C   s   |    d S )N)r"   )r   excvaluetbr   r   r   __exit__>   s    zTemporaryDirectory.__exit__c             C   s   | j dd d S )NT)r   )r"   )r   r   r   r   __del__A   s    zTemporaryDirectory.__del__)r   r   N)r   
__module____qualname____doc__r   r   r   r   r   r    r"   r&   r'   r   r   r   r   r
      s   

r
   zWWARNING: The conda.compat module is deprecated and will be removed in a future release.)file)Z
__future__r   r   r   r   warningsr    Ztempfiler   Zcommon.compatZPY3ZconfigparserZConfigParserZgateways.disk.linkr	   objectr
   printsysstderrr   r   r   r   <module>   s   
,