ó
^ęWc        
   @`  s  d  Z  d d l m Z m Z d d l Z d d l Z d d l m Z y d d l m	 Z
 Wn! e k
 r{ d d l m	 Z
 n Xy d d l m Z Wn! e k
 rģ d d l m Z n Xy d d l Z Wn] e k
 r#y d d l m Z Wq$e k
 rd d l Z e j e _ e j e _ q$Xn Xy d d l Z d   Z Wn* e k
 rid d	 l m Z d
   Z n Xd d d d d d d d d d g
 Z e j d) k rķe Z d d l m Z n3 d d l  Z  e! e  d  Z e rãe  j Z n d Z e j d* k rd   Z# e$ d  Z% n d   Z# e$ d  Z% d   Z& d   Z' d   Z( d+ Z) e j d, k rbe) d- 7Z) n  e j* j+ d%  pe j* d& k oe j, d' k Z- d(   Z. d S(.   sK   Stuff that differs in different Python versions and platform
distributions.i    (   t   absolute_importt   divisionN(   t	   text_type(   t
   dictConfig(   t   OrderedDict(   t	   ipaddressc          C`  s1   t  j d  t  j d  g }  t t t |    S(   Nt   stdlibt
   platstdlib(   t	   sysconfigt   get_patht   sett   filtert   bool(   t   paths(    (    sd   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/compat/__init__.pyt
   get_stdlib"   s    (   R   c          C`  s=   t  j d t  t  j d t d t  g }  t t t |    S(   Nt   standard_libt   plat_specific(   R   t   get_python_libt   TrueR
   R   R   (   R   (    (    sd   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/compat/__init__.pyR   +   s    t   logging_dictConfigR   t   uses_pycachet   console_to_strt
   native_strt   get_path_uidt   stdlib_pkgst   WINDOWSt   samefileR   i   i   (   t   cache_from_sourceR   c         C`  s9   y |  j  t j j  SWn t k
 r4 |  j  d  SXd  S(   Nt   utf_8(   t   decodet   syst
   __stdout__t   encodingt   UnicodeDecodeError(   t   s(    (    sd   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/compat/__init__.pyR   G   s    c         C`  s/   t  |  t  r+ |  j d | r$ d n d  S|  S(   Ns   utf-8t   replacet   strict(   t
   isinstancet   bytesR   (   R"   R#   (    (    sd   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/compat/__init__.pyR   M   s    c         C`  s   |  S(   N(    (   R"   (    (    sd   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/compat/__init__.pyR   S   s    c         C`  s    t  |  t  r |  j d  S|  S(   Ns   utf-8(   R%   R   t   encode(   R"   R#   (    (    sd   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/compat/__init__.pyR   V   s    c         C`  sH   t  |  d  r |  j   S|  j |  j |  j d d d } | d Sd  S(   Nt   total_secondsi   i  i
   i   i@B i@B (   t   hasattrR(   t   microsecondst   secondst   days(   t   tdt   val(    (    sd   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/compat/__init__.pyR(   ]   s    
#c         C`  s   t  t d  rM t j |  t j t j B } t j |  j } t j |  n7 t j j	 |   st t j
 |   j } n t d |    | S(   s)  
    Return path's uid.

    Does not follow symlinks:
        https://github.com/pypa/pip/pull/935#discussion_r5307003

    Placed this function in compat due to differences on AIX and
    Jython, that should eventually go away.

    :raises OSError: When path is a symlink or can't be read.
    t
   O_NOFOLLOWs1   %s is a symlink; Will not return uid for symlinks(   R)   t   ost   opent   O_RDONLYR/   t   fstatt   st_uidt   closet   patht   islinkt   statt   OSError(   R6   t   fdt   file_uid(    (    sd   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/compat/__init__.pyR   e   s    c         C`  sA   t  j j |   } |  j d  r= | j d  r= | d } n  | S(   sl   
    Expand ~ and ~user constructions.

    Includes a workaround for http://bugs.python.org/issue14768
    s   ~/s   //i   (   R0   R6   t
   expandusert
   startswith(   R6   t   expanded(    (    sd   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/compat/__init__.pyR<      s    t   pythont   wsgirefi   i   t   argparset   wint   clit   ntc         C`  so   t  t j d  r% t j j |  |  St j j t j j |    } t j j t j j |   } | | k Sd S(   s>   Provide an alternative for os.path.samefile on Windows/Python2R   N(   R)   R0   R6   R   t   normcaset   abspath(   t   file1t   file2t   path1t   path2(    (    sd   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/compat/__init__.pyR      s
    (   i   i   (   i   (   s   pythons   wsgiref(   i   i   (   s   argparse(/   t   __doc__t
   __future__R    R   R0   R   t   pip._vendor.sixR   t   logging.configR   R   t   ImportErrort   pip.compat.dictconfigt   collectionsR   t   pip.compat.ordereddictR   t   pip._vendort   ipaddrt	   IPAddresst
   ip_addresst	   IPNetworkt
   ip_networkR   R   t	   distutilst   __all__t   version_infoR   R   t   importlib.utilR   t   impR)   t   NoneR   t   FalseR   R(   R   R<   R   t   platformR=   t   nameR   R   (    (    (    sd   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/compat/__init__.pyt   <module>   sh   							