U
    }Haè  ã                   @   s   G d d„ dƒZ dS )c                   @   s(   e Zd ZdZdd„ Zdd„ Zdd„ ZdS )	ÚKeepContexta¤  
    Context manager that receives a `django.template.Context` instance and a list of keys

    Once the context manager is exited, it removes `keys` from the context, to avoid
    side effects in later layout objects that may use the same context variables.

    Layout objects should use `extra_context` to introduce context variables, never
    touch context object themselves, that could introduce side effects.
    c                 C   s   || _ || _d S ©N)ÚcontextÚkeys)Úselfr   r   © r   ú5/tmp/pip-unpacked-wheel-rp2i33ek/crispy_forms/base.pyÚ__init__   s    zKeepContext.__init__c                 C   s   d S r   r   )r   r   r   r   Ú	__enter__   s    zKeepContext.__enter__c                 C   s&   t | jƒD ]}|| jkr
| j|= q
d S r   )Úlistr   r   )r   ÚtypeÚvalueÚ	tracebackÚkeyr   r   r   Ú__exit__   s    
zKeepContext.__exit__N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r	   r   r   r   r   r   r      s   
r   N)r   r   r   r   r   Ú<module>   ó    