o $a% @s\dZddlZddlmZmZddlmZdedefddZe fded ed eddfd d Z dS) z sphinx.util.pycompat ~~~~~~~~~~~~~~~~~~~~ Stuff for Python version compatibility. :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. N)AnyCallable)RemovedInSphinx60Warningfilepathreturnc Cstjdtddzddlm}ddlm}m}Wnty'}zt |d}~ww|d}||}| |d}z | |d}Wt|S|ya} z| j d \} } t | j || | | jf| d} ~ ww) Nz!convert_with_2to3() is deprecated stacklevelr) ParseError)RefactoringToolget_fixers_from_packagez lib2to3.fixeszconf.py)warningswarnrlib2to3.pgen2.parser lib2to3.refactorr r ImportError SyntaxError_read_python_sourcerefactor_stringcontextmsgvaluestr) rr r r excfixersrefactoring_toolsourcetreeerrlinenooffsetr"6/usr/lib/python3/dist-packages/sphinx/util/pycompat.pyconvert_with_2to3s* r$_globalsopencCsrtjdtddddlm}||d }|}Wdn1s"wY||}t||d}t||dS)Nzexecfile_() is deprecatedrrr) fs_encodingrbexec) rrrsphinx.util.osutilr'readencodecompiler))rr%r&r'fr filepath_enccoder"r"r# execfile_1s     r1) __doc__rtypingrrsphinx.deprecationrrr$r&r1r"r"r"r#s   "