
    fa                     2    d Z ddlZddlmZ  G d de      Zy)z+Backport of Python 3.11's contextlib.chdir.    N)AbstractContextManagerc                   "    e Zd ZdZd Zd Zd Zy)chdirzHNon thread-safe context manager to change the current working directory.c                      || _         g | _        y)zInitialize the manager.N)path_old_cwd)selfr   s     \/var/www/cvtools/html/venv/lib/python3.12/site-packages/nbconvert/utils/_contextlib_chdir.py__init__zchdir.__init__
   s    	    c                     | j                   j                  t        j                                t        j                  | j
                         y)zEnter the context.N)r   appendosgetcwdr   r   )r	   s    r
   	__enter__zchdir.__enter__   s*    RYY[)
r   c                 ^    t        j                  | j                  j                                y)zExit the context.N)r   r   r   pop)r	   excinfos     r
   __exit__zchdir.__exit__   s    
""$%r   N)__name__
__module____qualname____doc__r   r   r    r   r
   r   r      s    R

&r   r   )r   r   
contextlibr   r   r   r   r
   <module>r      s    1 	 -&" &r   