3

Q'ícÁã@s|ddlZddlZddlZddlZddlZddlmZddlm	Z	dd„Z
e
Ze	ejj
ƒZGdd„deƒZ
Gd	d
„d
e
ƒZdS)éN)Úmapé)Ú
get_unpatchedcCs2d}yt|dgdjdStk
r,YnXdS)z0
    Return True if Cython can be imported.
    zCython.Distutils.build_extÚ	build_ext)ÚfromlistTF)Ú
__import__rÚ	Exception)Zcython_impl©r	ú:/tmp/pip-build-l_bcah40/setuptools/setuptools/extension.pyÚ_have_cythonsrc@s eZdZdZdd„Zdd„ZdS)Ú	Extensionz7Extension that uses '.c' files in place of '.pyx' filescOs(|jddƒ|_tj|||f|ž|ŽdS)NÚpy_limited_apiF)Úpopr
Ú
_ExtensionÚ__init__)ÚselfÚnameÚsourcesÚargsÚkwr	r	r
r#szExtension.__init__cCsNtƒr
dS|jpd}|jƒdkr$dnd}tjtjd|ƒ}tt||j	ƒƒ|_	dS)zÜ
        Replace sources with .pyx extensions to sources with the target
        language extension. This mechanism allows language authors to supply
        pre-converted sources but to prefer the .pyx sources.
        NÚzc++z.cppz.cz.pyx$)
rÚlanguageÚlowerÚ	functoolsÚpartialÚreÚsubÚlistrr)rÚlangZ
target_extrr	r	r
Ú_convert_pyx_sources_to_lang)s
z&Extension._convert_pyx_sources_to_langN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__rrr	r	r	r
r src@seZdZdZdS)ÚLibraryz=Just like a regular Extension, but built as a library insteadN)r r!r"r#r	r	r	r
r$8sr$)rrÚdistutils.coreÚ	distutilsZdistutils.errorsÚdistutils.extensionZsetuptools.extern.six.movesrZmonkeyrrZ
have_pyrexÚcorerrr$r	r	r	r
Ú<module>s