Y@0@sdZddlmZmZddlZddlZddlmZyddlm Z Wn"e k r|ddl m Z YnXyddl mZWn"e k rddlmZYnXyddlZWn_e k r'yddlmZWn6e k r"ddlZeje_eje_YnXYnXyddlZdd ZWn.e k rtdd lmZd d ZYnXd d ddddddddg Zejd.krdZddlmZn3ddlZe edZerejZndZejd/kr!ddZ!dddZ"nddZ!dddZ"d d!Z#d"dZ$d#d$Z%d0Z&ejd1kre&d27Z&ej'j(d*pej'd+koej)d,kZ*d-dZ+dS)3zKStuff that differs in different Python versions and platform distributions.)absolute_importdivisionN) text_type) dictConfig) OrderedDict) ipaddresscCs1tjdtjdg}ttt|S)Nstdlib platstdlib) sysconfigget_pathsetfilterbool)pathsr2/tmp/pip-build-3puug3g5/pip/pip/compat/__init__.py get_stdlib"s r)r cCs=tjddtjddddg}ttt|S)N standard_libT plat_specific)r get_python_libr r r)rrrrr+slogging_dictConfigr uses_pycacheconsole_to_str native_str get_path_uid stdlib_pkgsWINDOWSsamefilerT)cache_from_sourcer c Cs=y|jtjjSWntk r8|jdSYnXdS)Nutf_8)decodesys __stdout__encodingUnicodeDecodeError)srrrrGs FcCs/t|tr+|jd|r$dndS|S)Nzutf-8replacestrict) isinstancebytesr")r'r(rrrrMscCs|S)Nr)r'rrrrSscCs t|tr|jdS|S)Nzutf-8)r*rencode)r'r(rrrrVs cCsHt|dr|jS|j|j|jddd}|dSdS)N total_secondsi i@Bi@B)hasattrr- microsecondssecondsdays)tdvalrrrr-]s #r-cCsttdrMtj|tjtjB}tj|j}tj|n7tjj |sttj |j}nt 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  cCsDtjj|}|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>expandedrrrrEsrEpythonwsgirefargparsewinclintcCsottjdr%tjj||Stjjtjj|}tjjtjj|}||kSdS)z>Provide an alternative for os.path.samefile on Windows/Python2rN)r1r8r>rnormcaseabspath)file1file2path1path2rrrrs )rr)r)zpythonzwsgiref)rJrK)zargparse),__doc__ __future__rrr8r#pip._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