HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //lib64/python2.7/site-packages/mercurial/pycompat.pyo
�
1�3\c@@sdZddlmZddlZddlZddlZddlZddlZddlZej	ddkZ
dejkZe
s�ddl
Z
ddlZddlZddlZddlZddlZddlmZd�ZniddljZddljZ
ddljZddlZddlZddlZddljZd	�Zd
�Zd�Z d�Z!e
r*ddl"Z"ddl#Z#ddl$Z$ddl%Z%ej&Z&ej'Z'ej(j)d
�Z*ej+j)d
�Z,ej-j)d
�Z.ej/j)d
�Z0ej1j)d
�Z2ej3j)d
�Z4ej5Z6e6rCe6j)d
�Z6nej7j)d
�Z8ej9Z:e:rvej&e:�Z:ne$j;Z<e<Z=d�Z>d�Z?d�Z@eAZBejCZDeEZFejGjHZGejIjHZIejJjHZJeKedd�dk	reMeNej&ejO��ZPne%jQd�jRZSdjTZUdeVfd��YZWd�ZXd�ZYd�ZZd�Z[d�Z\d�Z]d�Z^d�Z_d�Z`e`e"ja�Zae`e"jK�ZKe`e"jb�Zbe`e"jc�Zce"jdZeefZgdd dd!�Zhe`e"jb�Zid"�Zjd#�Zkd$�Zlemend%�ZondddlpZpeeZeegZgeqZSerZUefZWesZXeZYeZZeZ[eZ\eZ]d&dUd'�Z&eZ'd(�Z_et�Zud)�Zid*�ZjeZkeZlej(Z*ej+Z,ej-Z.ej/Z0ej1Z2ej3Z4ej5Z6eFZFejGZGejIZIejJZJeKedd�dk	rCejOZPnej7Z8ej9Z:ejvZoepjwZ<e<Z=eNZ>edZ?exZ@eyZBejDZDe8jzd+�Z{e8d,kZ|e.d-kZ}e.d.kZ~d/�Zd0�Z�d1d2dd3�Z�d1d2dd4�Z�d5d d1d2dend6�Z�dS(7swMercurial portability shim for python 3.

This contains aliases to hide python version-specific details from the core.
i(tabsolute_importNit__pypy__i(tfuturescC@s|j|�dS(N(tset_exception_info(tftexc_info((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pytfuture_set_exception_info!scC@s|j|d�dS(Ni(t
set_exception(RR((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pyR,scC@s|S(N((ta((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pytidentity/sc@s�|dkr|St|tttf�rHt|��fd�|D��St|t�r}t|��fd�|j�D��S�|�S(Nc3@s|]}t�|�VqdS(N(t_rapply(t.0tx(R(s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pys	<genexpr>7sc3@s3|])\}}t�|�t�|�fVqdS(N(R
(Rtktv(R(s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pys	<genexpr>9s(tNonet
isinstancetlisttsetttuplettypetdicttitems(Rtxs((Rs8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pyR
2s &cC@s|tkr|St||�S(s�Apply function recursively to every item preserving the data structure

    >>> def f(x):
    ...     return 'f(%s)' % x
    >>> rapply(f, None) is None
    True
    >>> rapply(f, 'a')
    'f(a)'
    >>> rapply(f, {'a'}) == {'f(a)'}
    True
    >>> rapply(f, ['a', 'b', None, {'c': 'd'}, []])
    ['f(a)', 'f(b)', None, {'f(c)': 'f(d)'}, []]

    >>> xs = [object()]
    >>> rapply(identity, xs) is xs
    True
    (R	R
(RR((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pytrapply<stasciicG@stt|��S(N(Rtmap(targs((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pytmaplistmscG@stt|��S(N(Rtrange(R((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pyt	rangelistpscG@stt|��S(N(Rtzip(R((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pytziplistsstargvs>Bs%rtbytestrcB@s5eZdZdd�Zd�Zd�Zd�ZRS(s�A bytes which mostly acts as a Python 2 str

        >>> bytestr(), bytestr(bytearray(b'foo')), bytestr(u'ascii'), bytestr(1)
        ('', 'foo', 'ascii', '1')
        >>> s = bytestr(b'foo')
        >>> assert s is bytestr(s)

        __bytes__() should be called if provided:

        >>> class bytesable(object):
        ...     def __bytes__(self):
        ...         return b'bytes'
        >>> bytestr(bytesable())
        'bytes'

        There's no implicit conversion from non-ascii str as its encoding is
        unknown:

        >>> bytestr(chr(0x80)) # doctest: +ELLIPSIS
        Traceback (most recent call last):
          ...
        UnicodeEncodeError: ...

        Comparison between bytestr and bytes should work:

        >>> assert bytestr(b'foo') == b'foo'
        >>> assert b'foo' == bytestr(b'foo')
        >>> assert b'f' in bytestr(b'foo')
        >>> assert bytestr(b'f') in b'foo'

        Sliced elements should be bytes, not integer:

        >>> s[1], s[:2]
        (b'o', b'fo')
        >>> list(s), list(reversed(s))
        ([b'f', b'o', b'o'], [b'o', b'o', b'f'])

        As bytestr type isn't propagated across operations, you need to cast
        bytes to bytestr explicitly:

        >>> s = bytestr(b'foo').upper()
        >>> t = bytestr(s)
        >>> s[0], t[0]
        (70, b'F')

        Be careful to not pass a bytestr object to a function which expects
        bytearray-like behavior.

        >>> t = bytes(t)  # cast to bytes
        >>> assert type(t) is bytes
        tcC@sat|t�r|St|ttf�rQt|d�rQt|�jd�}ntj||�S(Nu	__bytes__uascii(RR"tbytest	bytearraythasattrtstrtencodet__new__(tclsts((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pyR)�scC@s4tj||�}t|t�s0t|�}n|S(N(R$t__getitem__Rtbytechr(tselftkeyR+((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pyR,�scC@sttj|��S(N(titerbytestrR$t__iter__(R.((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pyR1�scC@stj|�dS(Ni(R$t__repr__(R.((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pyR2�s(t__name__t
__module__t__doc__R)R,R1R2(((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pyR"�s
3		cC@s
tt|�S(s4Iterate bytes as if it were a str object of Python 2(RR-(R+((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pyR0�scC@st|t�rt|�S|S(sPromote bytes to bytestr(RR$R"(R+((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pytmaybebytestr�s
cC@s
|jd�S(s�Convert an internal str (e.g. keyword, __doc__) back to bytes

        This never raises UnicodeEncodeError, but only ASCII characters
        can be round-trip by sysstr(sysbytes(s)).
        uutf-8(R((R+((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pytsysbytes�scC@s#t|tj�r|S|jd�S(s8Return a keyword str to be passed to Python functions such as
        getattr() and str.encode()

        This never raises UnicodeDecodeError. Non-ascii characters are
        considered invalid and mapped to arbitrary but unique code points
        such that 'sysstr(a) != sysstr(b)' for all 'a != b'.
        ulatin-1(RtbuiltinsR'tdecode(R+((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pytsysstr�scC@s t|t�r|jd�S|S(s Converts a bytes url back to struascii(RR$R9(turl((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pytstrurl�s
cC@s t|t�r|jd�S|S(s0Converts a str url to bytes by encoding in asciiuascii(RR'R((R;((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pytbytesurl�s
cC@s|j|��dS(s(Raise exception with the given tracebackN(twith_traceback(texcttb((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pytraisewithtbscC@s,t|dd�}|dkr"|St|�S(sTGet docstring as bytes; may be None so gettext() won't confuse it
        with _('')u__doc__N(tgetattrRR7(tobjtdoc((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pytgetdocsc@s"tj���fd��}|S(Nc@s�|t|�|�S(N(R:(tobjecttnameR(R(s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pytws(t	functoolstwraps(RRH((Rs8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pyt
_wrapattrfunc
stri����cC@stj|t|�||�S(N(R8topenR:(RGtmodet	bufferingtencoding((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pyRMscC@s�g|D]}|jd�^q}|jd�}g|D]}|jd�^q8}||||�\}}g|D],}|djd�|djd�f^qr}g|D]}|jd�^q�}||fS(s
        Takes bytes arguments, converts them to unicode, pass them to
        getopt.getopt(), convert the returned values back to bytes and then
        return them for Python 3 compatibility as getopt.getopt() don't accepts
        bytes on Python 3.
        slatin-1ii(R9R((torigRt	shortlisttnamelistRtopts((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pyt_getoptbwrapper s""6"cC@s td�|j�D��}|S(s�
        Converts the keys of a python dictonary to str i.e. unicodes so that
        they can be passed as keyword arguments as dictonaries with bytes keys
        can't be passed as keyword arguments to functions on Python 3.
        cs@s*|] \}}|jd�|fVqdS(slatin-1N(R9(RR
R((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pys	<genexpr>6s(Rt	iteritems(tdic((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pyt	strkwargs0scC@s td�|j�D��}|S(s�
        Converts keys of python dictonaries to bytes as they were converted to
        str to pass that dictonary as a keyword argument on Python 3.
        cs@s*|] \}}|jd�|fVqdS(slatin-1N(R((RR
R((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pys	<genexpr>>s(RRV(RW((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pytbyteskwargs9scC@s>tj|jd�||�}g|D]}|jd�^q%S(s�
        Takes bytes argument, convert it to str i.e. unicodes, pass that into
        shlex.split(), convert the returned value to bytes and return that for
        Python 3 compatibility as shelx.split() don't accept bytes on Python 3.
        slatin-1(tshlextsplitR9R((R+tcommentstposixtretR((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pyt
shlexsplitBss2def raisewithtb(exc, tb):
    raise exc, None, tb
cC@s0t|t�r|Stdt|�j��dS(s�
        Partial backport from os.py in Python 3, which only accepts bytes.
        In Python 2, our paths should only ever be bytes, a unicode path
        indicates a bug.
        sexpect str, not %sN(RR't	TypeErrorRR3(tfilename((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pytfsencode^scC@st|dd�S(NR5(RBR(RC((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pyREnscC@st||t�tk	S(N(RBt_notset(tthingtattr((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pytsafehasattrsscC@s||||�S(N((RQRRRRS((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pyRUvstjavatdarwinR]tntcC@sttj|||�S(N(RUtgetopt(RRRRS((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pytgetoptb�scC@sttj|||�S(N(RURjt
gnu_getopt(RRRRS((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pyt
gnugetoptb�sR#ttmpcC@stj|||�S(N(ttempfiletmkdtemp(tsuffixtprefixtdir((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pyRp�scC@stj|||�S(N(Rotmkstemp(RqRrRs((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pyRt�ssw+bcC@s4t|�}tj||d|d|d|d|�S(NRqRrRstdelete(R:RotNamedTemporaryFile(RNtbufsizeRqRrRsRu((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pyt
namedtempfile�s(�R5t
__future__RRjtinspecttosRZtsysRotversion_infotispy3tbuiltin_module_namestispypyt	cookielibtcPickletpicklethttplibtQueuetqueuetSocketServertsocketservert	xmlrpclibtthirdparty.concurrentRRtconcurrent.futuresthttp.cookiejart	cookiejarthttp.clienttclientt
xmlrpc.clientR	R
RR8RItiotstructRbtfsdecodetcurdirR(toscurdirtlinesept	oslinesepRGtosnametpathsept	ospathseptpardirtospardirtseptosseptaltseptosaltseptplatformtsysplatformt
executablet
sysexecutabletBytesIOtbytesiotstringioRRR tinputtrawinputtgetfullargspect
getargspectinttlongtstdintbuffertstdouttstderrRBRRRR!tsysargvtStructtpackR-t__mod__tbytereprR$R"R0R6R7R:R<R=RARERKtdelattrR&tsetattrRtxrangeR'tunicodeRMRfRURXRYtFalsetTrueR_t	cStringIOtchrtreprtiterRFRcR[tStringIORt	raw_inputt
startswithtisjythontisdarwintisposixt	iswindowsRkRmRpRtRx(((s8/usr/lib64/python2.7/site-packages/mercurial/pycompat.pyt<module>	s			
												I