abc @`sdZddlmZmZddlZddlZddlmZyddlm Z Wn!e k r{ddl m Z nXyddl mZWn!e k rddlmZnXyddlZWn]e k r#yddlmZWq$e k rddlZeje_eje_q$XnXyddlZdZWn*e k ridd lmZd ZnXd d d dddddddg Zejd)kreZddlmZn3ddl Z e!e dZere jZndZejd*krdZ#e$dZ%ndZ#e$dZ%dZ&dZ'dZ(d+Z)ejd,krbe)d-7Z)nej*j+d%pej*d&koej,d'kZ-d(Z.dS(.sKStuff that differs in different Python versions and platform distributions.i(tabsolute_importtdivisionN(t text_type(t dictConfig(t OrderedDict(t ipaddresscC`s1tjdtjdg}ttt|S(Ntstdlibt platstdlib(t sysconfigtget_pathtsettfiltertbool(tpaths((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyt get_stdlib"s (RcC`s=tjdttjdtdtg}ttt|S(Nt standard_libt plat_specific(Rtget_python_libtTrueR R R (R ((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyR+stlogging_dictConfigRt uses_pycachetconsole_to_strt native_strt get_path_uidt stdlib_pkgstWINDOWStsamefileRii(tcache_from_sourceRcC`s9y|jtjjSWntk r4|jdSXdS(Ntutf_8(tdecodetsyst __stdout__tencodingtUnicodeDecodeError(ts((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyRGs cC`s/t|tr+|jd|r$dndS|S(Nsutf-8treplacetstrict(t isinstancetbytesR(R"R#((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyRMscC`s|S(N((R"((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyRSscC`s t|tr|jdS|S(Nsutf-8(R%Rtencode(R"R#((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyRVs cC`sHt|dr|jS|j|j|jddd}|dSdS(Nt total_secondsiii ii@Bi@B(thasattrR(t microsecondstsecondstdays(ttdtval((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyR(]s #cC`sttdrMtj|tjtjB}tj|j}tj|n7tjj |sttj |j}nt 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)tostopentO_RDONLYR/tfstattst_uidtclosetpathtislinktstattOSError(R6tfdtfile_uid((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyRes  cC`sAtjj|}|jdr=|jdr=|d}n|S(sl Expand ~ and ~user constructions. Includes a workaround for http://bugs.python.org/issue14768 s~/s//i(R0R6t expandusert startswith(R6texpanded((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyR<s tpythontwsgirefiitargparsetwintclitntcC`sottjdr%tjj||Stjjtjj|}tjjtjj|}||kSdS(s>Provide an alternative for os.path.samefile on Windows/Python2RN(R)R0R6Rtnormcasetabspath(tfile1tfile2tpath1tpath2((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyRs (ii(i(R?R@(ii(RA(/t__doc__t __future__RRR0Rtpip._vendor.sixRtlogging.configRRt ImportErrortpip.compat.dictconfigt collectionsRtpip._vendor.ordereddictRt pip._vendortipaddrt IPAddresst ip_addresst IPNetworkt ip_networkRRt distutilst__all__t version_infoRRtimportlib.utilRtimpR)tNoneRtFalseRR(RR<RtplatformR=tnameRR(((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pytsh