3 �Pf@�0@s dZddlmZmZddlZddlZddlmZyddlm Z Wn e k r`ddl m Z YnXyddl mZWn e k r�ddlmZYnXy ddlZWnRe k r�yddlmZWn,e k r�ddlZeje_eje_YnXYnXyddlZdd �ZWn*e k �r2dd lmZd d �ZYnXd d ddddddddg Zejd.k�rjdZddlmZn$ddlZe ed�Ze�r�ejZndZejd/k�r�dd�Z!d0dd�Z"ndd�Z!d1dd�Z"d d!�Z#d"d�Z$d#d$�Z%d2Z&ejd3k�r�e&d47Z&ej'j(d*��pej'd+k�oej)d,kZ*d-d�Z+dS)5zKStuff that differs in different Python versions and platform distributions.�)�absolute_import�divisionN)� text_type)� dictConfig)� OrderedDict)� ipaddresscCs"tjd�tjd�g}ttt|��S)N�stdlib� platstdlib)� sysconfig�get_path�set�filter�bool)�paths�r�/usr/lib/python3.6/__init__.py� get_stdlib"s r)r cCs(tjdd�tjddd�g}ttt|��S)NT)� standard_lib)rZ plat_specific)r Zget_python_libr r r)rrrrr+s �logging_dictConfigr� uses_pycache�console_to_str� native_str� get_path_uid� stdlib_pkgs�WINDOWS�samefiler��T)�cache_from_sourcerc Cs.y|jtjj�Stk r(|jd�SXdS)N�utf_8)�decode�sys� __stdout__�encoding�UnicodeDecodeError)�srrrrGsFcCs"t|t�r|jd|rdnd�S|S)Nzutf-8�replace�strict)� isinstance�bytesr )r%r&rrrrMs cCs|S)Nr)r%rrrrSscCst|t�r|jd�S|S)Nzutf-8)r(r�encode)r%r&rrrrVs  cCs<t|d�r|j�S|j|j|jddd}|dSdS)N� total_seconds�i� �i@Bi@B)�hasattrr+Z microsecondsZsecondsZdays)Ztd�valrrrr+]s r+cCs`ttd�r6tj|tjtjB�}tj|�j}tj|�n&tjj |�sPtj |�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) r/�os�open�O_RDONLYr1�fstat�st_uid�close�path�islink�stat�OSError)r8�fdZfile_uidrrrres     cCs0tjj|�}|jd�r,|jd�r,|dd�}|S)zl Expand ~ and ~user constructions. Includes a workaround for http://bugs.python.org/issue14768 z~/z//�N)r2r8� expanduser� startswith)r8Zexpandedrrrr>�s  r>�python�wsgiref���argparse�winZcli�ntcCsNttjd�rtjj||�Stjjtjj|��}tjjtjj|��}||kSdS)z>Provide an alternative for os.path.samefile on Windows/Python2rN)r/r2r8r�normcase�abspath)Zfile1Zfile2Zpath1Zpath2rrrr�s  )rr)r)F)F)r@rA)rBrC)rD),�__doc__Z __future__rrr2r!Zpip._vendor.sixrZlogging.configrr� ImportErrorZpip.compat.dictconfig� collectionsrZpip._vendor.ordereddictrZ pip._vendorZipaddrZ IPAddressZ ip_addressZ IPNetworkZ ip_networkr rZ distutils�__all__� version_inforZimportlib.utilrZimpr/rrr+rr>r�platformr?�namerrrrrr�sh