3
LY@              0   @   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
 W n  ek
r`   ddlm	Z
 Y nX yddlmZ W n  ek
r   ddlmZ Y nX yddlZW nR ek
r   yddlmZ W n, ek
r   ddlZeje_eje_Y nX Y nX yddlZdd	 ZW n* ek
r2   dd
lmZ dd	 ZY nX ddddddddddg
Zejd.krjdZddlmZ n$ddlZe edZerejZndZejd/krdd Z!d0ddZ"ndd Z!d1ddZ"d d! Z#d"d Z$d#d$ Z%d2Z&ejd3kre&d47 Z&ej'j(d*pej'd+koej)d,kZ*d-d Z+dS )5zKStuff that differs in different Python versions and platform
distributions.    )absolute_importdivisionN)	text_type)
dictConfig)OrderedDict)	ipaddressc              C   s"   t jdt jdg} ttt| S )Nstdlib
platstdlib)	sysconfigget_pathsetfilterbool)paths r   f/private/var/folders/7d/20zwc49s3kn54d3vgq8bd4640000gn/T/pip-build-an2lx5zf/pip/pip/compat/__init__.py
get_stdlib"   s    r   )r
   c              C   s(   t jddt jdddg} ttt| S )NT)standard_lib)r   plat_specific)r
   get_python_libr   r   r   )r   r   r   r   r   +   s    
logging_dictConfigr   uses_pycacheconsole_to_str
native_strget_path_uidstdlib_pkgsWINDOWSsamefiler         T)cache_from_sourcer    c             C   s.   y| j tjjS  tk
r(   | j dS X d S )Nutf_8)decodesys
__stdout__encodingUnicodeDecodeError)sr   r   r   r   G   s    Fc             C   s"   t | tr| jd|rdndS | S )Nzutf-8replacestrict)
isinstancebytesr"   )r'   r(   r   r   r   r   M   s    
c             C   s   | S )Nr   )r'   r   r   r   r   S   s    c             C   s   t | tr| jdS | S )Nzutf-8)r*   r   encode)r'   r(   r   r   r   r   V   s    

c             C   s<   t | dr| j S | j| j| jd d  d  }|d S d S )Ntotal_seconds   i  
      i@B i@B )hasattrr-   microsecondssecondsdays)tdvalr   r   r   r-   ]   s    
r-   c             C   s`   t tdr6tj| tjtjB }tj|j}tj| n&tjj	| sPtj
| j}ntd|  |S )a)  
    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.
    
O_NOFOLLOWz1%s is a symlink; Will not return uid for symlinks)r1   osopenO_RDONLYr7   fstatst_uidclosepathislinkstatOSError)r>   fdfile_uidr   r   r   r   e   s    

c             C   s0   t jj| }| jdr,|jdr,|dd }|S )zl
    Expand ~ and ~user constructions.

    Includes a workaround for http://bugs.python.org/issue14768
    z~/z//   N)r8   r>   
expanduser
startswith)r>   expandedr   r   r   rE      s    rE   pythonwsgiref      argparsewinclintc             C   sN   t tjdrtjj| |S tjjtjj| }tjjtjj|}||kS dS )z>Provide an alternative for os.path.samefile on Windows/Python2r   N)r1   r8   r>   r   normcaseabspath)file1file2path1path2r   r   r   r      s
    )r   r   )r   )F)F)rH   rI   )rJ   rK   )rL   ),__doc__
__future__r   r   r8   r#   pip._vendor.sixr   logging.configr   r   ImportErrorZpip.compat.dictconfigcollectionsr   Zpip._vendor.ordereddictr   pip._vendoripaddrZ	IPAddress
ip_addressZ	IPNetwork
ip_networkr
   r   	distutils__all__version_infor   importlib.utilr    impr1   r   r   r-   r   rE   r   platformrF   namer   r   r   r   r   r   <module>   sh   	


