Re%@sdZddlmZmZddlZddlZddlZddlZddlZddl Z ddl Z ddl m Z m Z ddlmZerddlmZmZmZmZmZmZmZedZGdd d eZyddlZWn_ek rcydd lmZWn6ek r^ddlZeje_ej e_!YnXYnXd d d dddddgZ"ej#e$Z%e rddl&Z&y e&j'Z'Wne(k rdZ'YnXe'dk Z)ndZ)ddl*m'Z'e rddZ+ej,de+dZ-ndZ-ddZ.dddZ/dd Z0ddZ1dd Z2d!d"d#hZ3e j4j5d$pe j4d%koej6d&kZ7d'dZ8e9e drd(dZ:n d)dZ:dd*d+Z;e<ed,e;Z=dS)-zKStuff that differs in different Python versions and platform distributions.)absolute_importdivisionN)PY2 text_type)MYPY_CHECK_RUNNING)CallableOptionalProtocolTextTupleTypeVarUnionFc@seZdZdddZdS)LruCacheNcCs tdS)N)NotImplementedError)selfmaxsizer/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/utils/compat.py__call__szLruCache.__call__)__name__ __module__ __qualname__rrrrrrs r) ipaddressr uses_pycacheconsole_to_str get_path_uid stdlib_pkgsWINDOWSsamefileget_terminal_sizeT)cache_from_sourcecs]fddtjjD}dd|D}djtdj|jfS)Nc3s|]}j|VqdS)N)object).0i)errrr Isz-backslashreplace_decode_fn..css|]}t|VqdS)N)ord)r#brrrr&Ksz\x{:x})rangestartendjoinmapformat)r%Z raw_bytesr)r%rbackslashreplace_decode_fnHs(r0backslashreplace_decodebackslashreplacec Cs=yddl}dSWntk r(YnXddlm}|S)NrT) IS_PYOPENSSL)_ssl ImportErrorpip._vendor.urllib3.utilr3)r4r3rrrhas_tlsVs  r7c Cst|tr|Stj}| s>tj|jdkrDd}y|j|}Wn@tk rt j d|pyd||j|dt }YnXt t t dddd}|r|j|dd }|j|}|S) a For display or logging purposes, convert a bytes object (or text) to text (e.g. unicode in Python 2) safe for output. :param desc: An optional phrase describing the input data, for use in the log message if a warning is logged. Defaults to "Bytes object". This function should never error out and so can take a best effort approach. It is okay to be lossy if needed since the return value is just for display. We assume the data is in the locale preferred encoding. If it won't decode properly, we warn the user but decode as best we can. We also ensure that the output can be safely written to standard output without encoding errors. asciizutf-8z&%s does not appear to be encoded as %sz Bytes objecterrors __stderr__Nencodingr2) isinstancerlocalegetpreferredencodingcodecslookupnamedecodeUnicodeDecodeErrorloggerwarningr1getattrsysencode)datadescr; decoded_dataoutput_encodingoutput_encodedrrrstr_to_displaybs*     rNcCst|ddS)zProvide an alternative for os.path.samefile on Windows/Python2rN)rPrQrWrnormcaseabspath)file1file2path1path2rrrrs cCsttjS)z Returns a tuple (x, y) representing the width(x) and the height(y) in characters of the terminal window. )tupleshutilr rrrrr sc Csdd}|dp-|dp-|d}|stjdkry8tjtjtj}||}tj|Wntk rYnX|stjj ddtjj d d f}t |dt |dfS) z Returns a tuple (x, y) representing the width(x) and the height(y) in characters of the terminal window. c SsyyLddl}ddl}ddl}|jd|j||jd}Wntk rddSYnX|dkrudS|S)NrhhZ12345678)rr)fcntltermiosstruct unpack_fromZioctl TIOCGWINSZ Exception)r[rprqrrcrrrr ioctl_GWINSZs      z'get_terminal_size..ioctl_GWINSZrr]win32LINESCOLUMNSP) rGplatformrQrRctermidrSrVruenvirongetint)rwrvr[rrrr s $  *cCsdd}|S)NcSs|S)Nr)frrr_wrappersz noop_lru_cache.._wrapperr)rrrrrnoop_lru_caches r lru_cache)>__doc__ __future__rrr? functoolsr=loggingrQrnrGZpip._vendor.sixrrpip._internal.utils.typingrtypingrrr r r r r rrrr5 pip._vendoripaddrZ IPAddress ip_addressZ IPNetwork ip_network__all__ getLoggerrrDimpr!AttributeErrorrimportlib.utilr0register_errorr1r7rNrrr^rr~r_rArrrPr rrFrrrrrsp       4             C     $