U
    @{?^                     @   s|   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 Z
e
Ze	ejjZG dd deZG d	d
 d
eZdS )    N)map   )get_unpatchedc                  C   s4   d} zt | dgdj W dS  tk
r.   Y nX dS )z0
    Return True if Cython can be imported.
    zCython.Distutils.build_ext	build_ext)fromlistTF)
__import__r   	Exception)Zcython_impl r	   6/usr/lib/python3/dist-packages/setuptools/extension.py_have_cython   s    r   c                   @   s    e Zd ZdZdd Zdd ZdS )	Extensionz7Extension that uses '.c' files in place of '.pyx' filesc                 O   s(   | dd| _tj| ||f|| d S )Npy_limited_apiF)popr   
_Extension__init__)selfnamesourcesargskwr	   r	   r
   r   #   s    zExtension.__init__c                 C   sN   t  r
dS | jpd}| dkr$dnd}t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   Zlanguagelower	functoolspartialresublistr   r   )r   Z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
   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"   8   s   r"   )r   r   Zdistutils.coreZ	distutilsZdistutils.errorsZdistutils.extensionZsetuptools.extern.six.movesr   Zmonkeyr   r   Z
have_pyrexZcorer   r   r"   r	   r	   r	   r
   <module>   s   