3

T'íczã@sTdZddlZddlmZmZddlmZeedœdd„Ze	feeeddœd	d
„Z
dS)z'Stuff for Python version compatibility.éN)ÚAnyÚCallable)ÚRemovedInSphinx60Warning)ÚfilepathÚreturnc CsÚtjdtddy ddlm}ddlm}m}Wn(tk
rX}zt	|‚WYdd}~XnX|dƒ}||ƒ}|j
|ƒd}y|j|dƒ}WnH|k
rÐ}	z,|	jd	\}
}t	|	j
||
||	jfƒ|	‚WYdd}	~	XnXt|ƒS)
Nz!convert_with_2to3() is deprecatedé)Ú
stacklevelr)Ú
ParseError)ÚRefactoringToolÚget_fixers_from_packagez
lib2to3.fixeszconf.pyé)ÚwarningsÚwarnrZlib2to3.pgen2.parser	Úlib2to3.refactorr
rÚImportErrorÚSyntaxErrorZ_read_python_sourceZrefactor_stringÚcontextÚmsgÚvalueÚstr)rr	r
rÚexcZfixersZrefactoring_toolÚsourceÚtreeÚerrÚlinenoÚoffset©rú6/tmp/pip-build-gk9425m9/sphinx/sphinx/util/pycompat.pyÚconvert_with_2to3s 
*r)rÚ_globalsÚopenrcCs^tjdtddddlm}||dƒ}|jƒ}WdQRX|j|ƒ}t||dƒ}t||ƒdS)Nzexecfile_() is deprecatedr)rr)Úfs_encodingÚrbÚexec)	r
rrZsphinx.util.osutilr!ÚreadÚencodeÚcompiler#)rrr r!ÚfrZfilepath_encÚcoderrrÚ	execfile_)s

r))Ú__doc__r
ÚtypingrrZsphinx.deprecationrrrr r)rrrrÚ<module>s