Ńň
ÍDŔLc           @   s  d  d k  l Z d  d k  l Z d   Z e e  Z e e  Z y d  d k l Z Wn e j
 o e	 Z
 n Xe Z
 d e f d     YZ d e f d     YZ d  d	 k Z d  d	 k  Z d  d	 k Z e e i _ e e i _ d
 e i j o e e i d
 _ n d	 S(   i˙˙˙˙(   t	   Extension(   t   Distributionc         C   sR   x$ |  i  i d  o |  i \ }  q W|  i  i d  p t d |    n |  S(   s   Protect against re-patching the distutils if reloaded

    Also ensures that no other distutils extension monkeypatched the distutils
    first.
    t
   setuptoolst	   distutilss(   distutils has already been patched by %r(   t
   __module__t
   startswitht	   __bases__t   AssertionError(   t   cls(    (    s:   scripts/common/Lib/distutils/tests/setuptools_extension.pyt   _get_unpatched   s     (   t	   build_extR    c           B   s"   e  Z d  Z e p d   Z n RS(   s7   Extension that uses '.c' files in place of '.pyx' filesc         O   sp   t  i |  | |  g  } xG |  i D]< } | i d  o | i | d  d  q# | i |  q# W| |  _ d  S(   Ns   .pyxiý˙˙˙t   c(   t
   _Extensiont   __init__t   sourcest   endswitht   append(   t   selft   argst   kwR   t   s(    (    s:   scripts/common/Lib/distutils/tests/setuptools_extension.pyR   "   s    
 (   t   __name__R   t   __doc__t
   have_pyrexR   (    (    (    s:   scripts/common/Lib/distutils/tests/setuptools_extension.pyR       s   t   Libraryc           B   s   e  Z d  Z RS(   s=   Just like a regular Extension, but built as a library instead(   R   R   R   (    (    (    s:   scripts/common/Lib/distutils/tests/setuptools_extension.pyR   ,   s   Ns   distutils.command.build_ext(   t   distutils.coreR    R   R   t   _DistributionR	   t   Pyrex.Distutils.build_extR
   t   ImportErrort   FalseR   t   TrueR   t   sysR   t   distutils.extensiont   coret	   extensiont   modules(    (    (    s:   scripts/common/Lib/distutils/tests/setuptools_extension.pyt   <module>   s    	$