
    ^ha                     2    S r SSKrSSKJr   " S S\5      rg)z+Backport of Python 3.11's contextlib.chdir.    N)AbstractContextManagerc                   *    \ rS rSrSrS rS rS rSrg)chdir   zHNon thread-safe context manager to change the current working directory.c                     Xl         / U l        g)zInitialize the manager.N)path_old_cwd)selfr   s     [/home/james-whalen/.local/lib/python3.13/site-packages/nbconvert/utils/_contextlib_chdir.py__init__chdir.__init__
   s    	    c                     U R                   R                  [        R                  " 5       5        [        R                  " U R
                  5        g)zEnter the context.N)r	   appendosgetcwdr   r   )r
   s    r   	__enter__chdir.__enter__   s*    RYY[)
r   c                 `    [         R                  " U R                  R                  5       5        g)zExit the context.N)r   r   r	   pop)r
   excinfos     r   __exit__chdir.__exit__   s    
""$%r   )r	   r   N)	__name__
__module____qualname____firstlineno____doc__r   r   r   __static_attributes__ r   r   r   r      s    R

&r   r   )r   r   
contextlibr   r   r    r   r   <module>r"      s    1 	 -&" &r   