
    }cz              	       Z    d Z ddlZddlmZmZ ddlmZ dedefdZe	fdeded	eddfd
Z
dS )z'Stuff for Python version compatibility.    N)AnyCallable)RemovedInSphinx60Warningfilepathreturnc                    t          j        dt          d           	 ddlm} ddlm}m} n# t          $ r}t          |d }~ww xY w |d          } ||          }|
                    |           d         }	 |                    |d          }n<# |$ r4}	|	j        d	         \  }
}t          |	j        | |
||	j        f          |	d }	~	ww xY wt          |          S )
Nz!convert_with_2to3() is deprecated   
stacklevelr   )
ParseError)RefactoringToolget_fixers_from_packagezlib2to3.fixeszconf.py   )warningswarnr   lib2to3.pgen2.parser   lib2to3.refactorr   r   ImportErrorSyntaxError_read_python_sourcerefactor_stringcontextmsgvaluestr)r   r   r   r   excfixersrefactoring_toolsourcetreeerrlinenooffsets               4lib/python3.11/site-packages/sphinx/util/pycompat.pyconvert_with_2to3r%      s6   M5*q: : : :#222222MMMMMMMMM # # # s"	# %$_55F&v..11(;;A>FS//	BB S S SQ #'Hffci#HIIsRS t99s*   - 
A?A9B C	/CC	_globalsopenc                 &   t          j        dt          d           ddlm}  || d          5 }|                                }d d d            n# 1 swxY w Y   |                     |          }t          ||d          }t          ||           d S )Nzexecfile_() is deprecatedr	   r
   r   )fs_encodingrbexec)	r   r   r   sphinx.util.osutilr)   readencodecompiler+   )r   r&   r'   r)   fr   filepath_enccodes           r$   	execfile_r3   )   s    M-*q: : : :......	h		                ??;//L6<00Dxs   AAA)__doc__r   typingr   r   sphinx.deprecationr   r   r%   r'   r3        r$   <module>r9      s    - -                  7 7 7 7 7 7     6 >B 
 
 
s 
( 
d 
 
 
 
 
 
r8   