GhostManSec
Server: Apache
System: Linux s323.xrea.com 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64
User: moonarc (17751)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //usr/lib/python2.7/site-packages/_pytest/compat.pyo
�
��abc
@`s�dZddlmZmZmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
yddlZWnek
r�dZnXe	jd1kZeZer�ddlmZmZnddlmZmZed�Ze�Ze	jd d2kZe	jd d3kZerBd
ndZd�ZejZej Z e!e	d
d��Z"eej#d��Z$d�Z%d�Z&d�Z'd�Z(e)dd�Z*ere+e,fZ-e,fZ.er�d�Z/n	d�Z/d�Z0n!e+e,e1fZ-e1fZ.d�Z0d�Z2d�Z3d�Z4d�Z5d�Z6erbd�Z7n	d�Z7d4Z8d*�Z9er�dd+l:m;Z;d,e;fd-��YZ<n%ddl=Z=d,e=j>fd.��YZ<d/efd0��YZ?dS(5s#
python version compatibility code
i(tabsolute_importtdivisiontprint_functionN(tTEST_OUTCOMEi(t	signaturet	ParameteriiitModuleNotFoundErrortImportErrorcC`stt|��S(N(tstrR(tfunc((s2/usr/lib/python2.7/site-packages/_pytest/compat.pyt_format_args*st	exc_clearcC`sdS(N(tNone(((s2/usr/lib/python2.7/site-packages/_pytest/compat.pyt<lambda>1tRcC`s tj|�}|ot|�S(N(tinspecttisgeneratorfunctiontiscoroutinefunction(R	tgenfunc((s2/usr/lib/python2.7/site-packages/_pytest/compat.pytis_generator6scC`s.t|dt�p-ttd�o-tj|�S(s�Return True if func is a decorated coroutine function.

    Note: copied and modified from Python 3.5's builtin couroutines.py to avoid import asyncio directly,
    which in turns also initializes the "logging" module as side-effect (see issue #8).
    t
_is_coroutineR(tgetattrtFalsethasattrRR(R	((s2/usr/lib/python2.7/site-packages/_pytest/compat.pyR;scC`sctjjtj|��}tjj|�j}|j|�rQ|j|�}nd||dfS(Ns%s:%di(	tpytpathtlocalRtgetfiletbuiltint_getcodetco_firstlinenotrelto(tfunctiontcurdirtfntlineno((s2/usr/lib/python2.7/site-packages/_pytest/compat.pytgetlocationEs
cC`s�t|dd�}|sdStjjd�tjjd�g}t|�r�g|D]}|dk	rS|j^qS}tg|D]%}|jr~|j	|kr~|^q~�St|�S(s? return number of arguments used up by mock arguments (if any) t	patchingsitmocks
unittest.mockN(
RRtsystmodulestgettanytDEFAULTtlentattribute_nametnew(R R%tmock_modulestmt	sentinelstp((s2/usr/lib/python2.7/site-packages/_pytest/compat.pytnum_mock_patch_argsMs$(&cC`s�td�t|�jj�D��}|sS|r`t|jj|jd�t	�r`|d}nt
|d�r�|t|�}n|S(s	Returns the names of a function's mandatory arguments.

    This should return the names of all function arguments that:
        * Aren't bound to an instance or type as in instance or class methods.
        * Don't have default values.
        * Aren't bound with functools.partial.
        * Aren't replaced with mocks.

    The is_method and cls arguments indicate that the function should
    be treated as a bound method even though it's not unless, only in
    the case of cls, the function is a static method.

    @RonnyPfannschmidt: This function should be refactored when we
    revisit fixtures. The fixture mechanism should ask the node for
    the fixture names, and not try to obtain directly from the
    function object well after collection has occurred.

    cs`sN|]D}|jtjks-|jtjkr|jtjkr|jVqdS(N(tkindRtPOSITIONAL_OR_KEYWORDtKEYWORD_ONLYtdefaulttemptytname(t.0R2((s2/usr/lib/python2.7/site-packages/_pytest/compat.pys	<genexpr>qsit__wrapped__N(ttupleRt
parameterstvaluest
isinstancet__dict__R)t__name__RtstaticmethodRR3(R t	is_methodtclst	arg_names((s2/usr/lib/python2.7/site-packages/_pytest/compat.pytgetfuncargnamesZs%

cC`s|jdd�S(Ntasciitbackslashreplace(tdecode(tval((s2/usr/lib/python2.7/site-packages/_pytest/compat.pyt_bytes_to_ascii�scC`s0|r(tj|�\}}|jd�SdSdS(NRGR(tcodecst
escape_encodeRI(RJt
encoded_bytest_((s2/usr/lib/python2.7/site-packages/_pytest/compat.pyRK�s
cC`s3t|t�rt|�S|jd�jd�SdS(s9If val is pure ascii, returns it as a str().  Otherwise, escapes
        bytes objects into a sequence of escaped bytes:

        b'ô��' -> u'\xc3\xb4\xc5\xd6'

        and escapes unicode objects into a sequence of escaped unicode
        ids, e.g.:

        '4\nV\U00043efa\x0eMXWB\x1e\u3028\u15fd\xcd\U0007d944'

        note:
           the obvious "v.decode('unicode-escape')" will return
           valid utf-8 unicode if it finds them in bytes, but we
           want to return escaped bytes for any byte, even if they match
           a utf-8 string.

        tunicode_escapeRGN(R?tbytesRKtencodeRI(RJ((s2/usr/lib/python2.7/site-packages/_pytest/compat.pyt
ascii_escaped�s
cC`sRt|t�rAy|jd�SWqNtk
r=|jd�SXn
|jd�SdS(sIn py2 bytes and str are the same type, so return if it's a bytes
        object, return it unchanged if it is a full ascii string,
        otherwise escape it into its binary form.

        If it's a unicode string, change the unicode characters into
        unicode escapes.

        RGs
string-escapesunicode-escapeN(R?RQRRtUnicodeDecodeError(RJ((s2/usr/lib/python2.7/site-packages/_pytest/compat.pyRS�s	
cC`s�|}xrtd�D].}t|dd�}|dkr;Pn|}qWtdjdtjj|�dtjj|����t|t	j
�r�|j}n|S(sq gets the real function object of the (possibly) wrapped object by
    functools.wraps or functools.partial.
    idR;s<could not find real function of {start}
stopped at {current}tstarttcurrentN(trangeRRt
ValueErrortformatRtiotsafereprR?t	functoolstpartialR	(tobjt	start_objtitnew_obj((s2/usr/lib/python2.7/site-packages/_pytest/compat.pyt
get_real_func�s
	cC`s=t|�}t|d�r'|j}ntjj|�}|S(Ntplace_as(RbRRct_pytestt_codetgetfslineno(R^tfslineno((s2/usr/lib/python2.7/site-packages/_pytest/compat.pyRf�s
cC`s$y|jSWntk
r|SXdS(N(t__func__tAttributeError(R	((s2/usr/lib/python2.7/site-packages/_pytest/compat.pyt	getimfunc�s
cC`s-yt|||�SWntk
r(|SXdS(sN Like getattr but return default upon any Exception or any OutcomeException.

    Attribute access can potentially fail for 'evil' Python objects.
    See issue #214.
    It catches OutcomeException because of #2490 (issue #580), new outcomes are derived from BaseException
    instead of Exception (for more details check #2707)
    N(RR(tobjectR9R7((s2/usr/lib/python2.7/site-packages/_pytest/compat.pytsafe_getattr�s
cC`s
tjdkS(sYReturn if the test suite should fail if a @expectedFailure unittest test PASSES.

    From https://docs.python.org/3/library/unittest.html?highlight=unittest#unittest.TestResult.wasSuccessful:
        Changed in version 3.4: Returns False if there were any
        unexpectedSuccesses from tests marked with the expectedFailure() decorator.
    ii(ii(R'tversion_info(((s2/usr/lib/python2.7/site-packages/_pytest/compat.pyt)_is_unittest_unexpected_success_a_failure�scC`s
t|�S(sreturns v as string(R(tv((s2/usr/lib/python2.7/site-packages/_pytest/compat.pytsafe_str�scC`sWyt|�SWnBtk
rRt|t�s<t|�}nd}|jd|�SXdS(s5returns v as string, converting to ascii if necessarytreplacesutf-8N(RtUnicodeErrorR?tunicodeRR(Roterrors((s2/usr/lib/python2.7/site-packages/_pytest/compat.pyRps
t	CollectortModulet	GeneratortFunctiontInstancetSessiontItemtClasstFilet
_fillfuncargscC`shddlm}ddl}|d�|_g|j_x*tD]"}t|j|t||��q>WdS(Ni(t
ModuleTypespytest.collect(ttypesRtpytesttcollectt__all__tCOLLECT_FAKEMODULE_ATTRIBUTEStsetattrR(RR�tattr((s2/usr/lib/python2.7/site-packages/_pytest/compat.pyt_setup_collect_fakemodules
(tTextIOt	CaptureIOcB`seZed��ZRS(cC`st|dd�S(Nt	_encodingsUTF-8(R(tself((s2/usr/lib/python2.7/site-packages/_pytest/compat.pytencoding*s(RAt
__module__tpropertyR�(((s2/usr/lib/python2.7/site-packages/_pytest/compat.pyR�(scB`seZd�Zd�ZRS(cC`s2tt|�jtj�dddddt�dS(NR�sUTF-8tnewlineRt
write_through(tsuperR�t__init__RZtBytesIOtTrue(R�((s2/usr/lib/python2.7/site-packages/_pytest/compat.pyR�2scC`s|jj�jd�S(NsUTF-8(tbuffertgetvalueRI(R�((s2/usr/lib/python2.7/site-packages/_pytest/compat.pyR�8s(RAR�R�R�(((s2/usr/lib/python2.7/site-packages/_pytest/compat.pyR�1s	tFuncargnamesCompatAttrcB`seZdZed��ZRS(s� helper class so that Metafunc, Function and FixtureRequest
    don't need to each define the "funcargnames" compatibility attribute.
    cC`s|jS(s? alias attribute for ``fixturenames`` for pre-2.3 compatibility(tfixturenames(R�((s2/usr/lib/python2.7/site-packages/_pytest/compat.pytfuncargnames@s(RAR�t__doc__R�R�(((s2/usr/lib/python2.7/site-packages/_pytest/compat.pyR�<s(ii(ii(ii(
RuRvRwRxRyRzR{R|R}R~(@R�t
__future__RRRRLR\RtreR'RRdt_pytest.outcomesRtenumRRRmt_PY3t_PY2RRtfuncsigsttypetNoneTypeRktNOTSETtPY35tPY36tMODULE_NOT_FOUND_ERRORR
t
isfunctiontisclassRRtcompilet
REGEX_TYPERRR$R3RRFRQRtSTRING_TYPESt
UNICODE_TYPESRKRSRsRbRfRjRlRnRpR�R�tpy.ioR�R�RZt
TextIOWrapperR�(((s2/usr/lib/python2.7/site-packages/_pytest/compat.pyt<module>s�

						
		
(