
ˆ`@_ž  ã               @   s  d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l m Z d d l	 m
 Z
 d d l m Z e
 e j j ƒ Z e j ƒ  d d „  Z e Z Gd d	 „  d	 e ƒ Z Gd
 d „  d e ƒ Z e e j _ e e j _ d e  j k r	e e  j d _ d S)é    N)Úmapé   )Ú_get_unpatched)Úmsvc9_supportc              C   s=   d }  y t  |  d d g ƒj d SWn t k
 r8 Yn Xd S)z0
    Return True if Cython can be imported.
    úCython.Distutils.build_extÚfromlistÚ	build_extTF)r   )Ú
__import__r   Ú	Exception)Zcython_impl© r   ú:/tmp/pip-build-tw3_dw7d/setuptools/setuptools/extension.pyÚ_have_cython   s    r   c               @   s"   e  Z d  Z d Z d d „  Z d S)Ú	Extensionz7Extension that uses '.c' files in place of '.pyx' filesc             C   sq   t  ƒ  r d S|  j p d } | j ƒ  d k r4 d n d } t j t j d | ƒ } t t | |  j	 ƒ ƒ |  _	 d S)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Ú zc++z.cppz.cz.pyx$)
r   ÚlanguageÚlowerÚ	functoolsÚpartialÚreÚsubÚlistr   Úsources)ÚselfÚlangZ
target_extr   r   r   r   Ú_convert_pyx_sources_to_lang%   s    	z&Extension._convert_pyx_sources_to_langN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   "   s   r   c               @   s   e  Z d  Z d Z d S)ÚLibraryz=Just like a regular Extension, but built as a library insteadN)r   r   r   r   r   r   r   r   r   3   s   r   zdistutils.command.build_ext)Úsysr   r   Údistutils.coreÚ	distutilsZdistutils.errorsÚdistutils.extensionZsetuptools.extern.six.movesr   Údistr   r   r   Úcorer   Z
_ExtensionZpatch_for_specialized_compilerr   Z
have_pyrexr   Ú	extensionÚmodulesr   r   r   r   Ú<module>   s$   
