3 ]@0@s dZddlmZmZddlZddlZddlmZyddlm Z Wn e k r`ddl m Z YnXyddl mZWn e k rddlmZYnXy ddlZWnRe k ryddlmZWn,e k rddlZeje_eje_YnXYnXyddlZdd ZWn*e k r2dd lmZd d ZYnXd d ddddddddg Zejd.krjdZddlmZn$ddlZe edZerejZndZejd/krddZ!d0ddZ"nddZ!d1ddZ"d d!Z#d"dZ$d#d$Z%d2Z&ejd3kre&d47Z&ej'j(d*pej'd+koej)d,kZ*d-dZ+dS)5zKStuff that differs in different Python versions and platform distributions.)absolute_importdivisionN) text_type) dictConfig) OrderedDict) ipaddresscCs"tjdtjdg}ttt|S)Nstdlib platstdlib) sysconfigget_pathsetfilterbool)pathsr2/tmp/pip-build-8jg9gmni/pip/pip/compat/__init__.py get_stdlib"s r)r cCs(tjddtjdddg}ttt|S)NT) standard_lib)r plat_specific)r get_python_libr r r)rrrrr+s logging_dictConfigr uses_pycacheconsole_to_str native_str get_path_uid stdlib_pkgsWINDOWSsamefilerT)cache_from_sourcer c Cs.y|jtjjStk r(|jdSXdS)Nutf_8)decodesys __stdout__encodingUnicodeDecodeError)srrrrGsFcCs"t|tr|jd|rdndS|S)Nzutf-8replacestrict) isinstancebytesr")r'r(rrrrMs cCs|S)Nr)r'rrrrSscCst|tr|jdS|S)Nzutf-8)r*rencode)r'r(rrrrVs  cCs<t|dr|jS|j|j|jddd}|dSdS)N total_secondsi i@Bi@B)hasattrr- microsecondssecondsdays)tdvalrrrr-]s r-cCs`ttdr6tj|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) r1osopenO_RDONLYr7fstatst_uidclosepathislinkstatOSError)r>fdfile_uidrrrres     cCs0tjj|}|jdr,|jdr,|dd}|S)zl Expand ~ and ~user constructions. Includes a workaround for http://bugs.python.org/issue14768 z~/z//N)r8r> expanduser startswith)r>expandedrrrrEs  rEpythonwsgirefargparsewinclintcCsNttjdrtjj||Stjjtjj|}tjjtjj|}||kSdS)z>Provide an alternative for os.path.samefile on Windows/Python2rN)r1r8r>rnormcaseabspath)file1file2path1path2rrrrs  )rr)r)F)F)rHrI)rJrK)rL),__doc__ __future__rrr8r#Zpip._vendor.sixrlogging.configrr ImportErrorZpip.compat.dictconfig collectionsrZpip._vendor.ordereddictr pip._vendoripaddrZ IPAddress ip_addressZ IPNetwork ip_networkr r distutils__all__ version_inforimportlib.utilr impr1rrr-rrErplatformrFnamerrrrrrsh