ó
¨9Vc           @   sL   y d  d l  Z Wn e k
 r# n Xe ƒ  Z d „  Z d „  Z d „  Z d S(   iÿÿÿÿNc           C   sO   d t  ƒ  k r d St r d St j t t j ƒ ƒ t t j _ t t j _ d S(   sÊ   
    Patch functions in distutils.msvc9compiler to use the standalone compiler
    build for Python (Windows only). Fall back to original behavior when the
    standalone compiler is not available.
    t	   distutilsN(   t   globalst	   unpatchedt   updatet   varsR    t   msvc9compilert   find_vcvarsallt   query_vcvarsall(    (    (    s<   /tmp/pip-build-5Z5nTX/setuptools/setuptools/msvc9_support.pyt   patch_for_specialized_compiler   s    c         C   sÚ   t  j j } d } | d |  f } y | j | d ƒ } WnQ t k
 r‹ y& | d |  f } | j | d ƒ } WqŒ t k
 r‡ d  } qŒ Xn X| rÌ d d  l } | j j | d ƒ } | j j	 | ƒ rÌ | Sn  t
 d |  ƒ S(   Ns-   Software\%sMicrosoft\DevDiv\VCForPython\%0.1ft    t
   installdirs   Wow6432Node\iÿÿÿÿs   vcvarsall.batR   (   R    R   t   Regt	   get_valuet   KeyErrort   Nonet   ost   patht   joint   isfileR   (   t   versionR   t   VC_BASEt   keyt
   productdirR   t	   vcvarsall(    (    s<   /tmp/pip-build-5Z5nTX/setuptools/setuptools/msvc9_support.pyR      s"    c         O   s«   y t  d |  | | Ž SWnŒ t j j k
 r¦ } | r  d | j d k r  d |  | j d f } t |  ƒ d k r‹ t j j | d ƒ ‚ n  t j j | ƒ ‚ n  ‚  n Xd  S(   NR   s   vcvarsall.bati    s,   Microsoft Visual C++ %0.1f is required (%s).i	   s%    Get it from http://aka.ms/vcpython27(   R   R    t   errorst   DistutilsPlatformErrort   argst   int(   R   R   t   kwargst   exct   message(    (    s<   /tmp/pip-build-5Z5nTX/setuptools/setuptools/msvc9_support.pyR   2   s    	(   t   distutils.msvc9compilerR    t   ImportErrort   dictR   R   R   R   (    (    (    s<   /tmp/pip-build-5Z5nTX/setuptools/setuptools/msvc9_support.pyt   <module>   s   			