
    @h                        d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	 ddlm
Z
 dd	lmZ eee   ee
e   f   Z ed
      Z G d de      Ze G d de	e                ZeZy)z"
Hook wrapper "result" utilities.
    )annotations)TracebackType)Callable)cast)final)Generic)Optional)TypeVar
ResultTypec                      e Zd ZdZy)HookCallErrorzHook was called incorrectly.N)__name__
__module____qualname____doc__     Y/var/www/html/Telegram-Engagement-Pod-/env/lib/python3.12/site-packages/pluggy/_result.pyr   r      s    &r   r   c                  v    e Zd ZdZdZ	 	 	 	 	 	 ddZedd       Zedd       Ze	dd       Z
ddZddZdd	Zy
)ResultzYAn object used to inspect and set the result in a :ref:`hook wrapper
    <hookwrappers>`._result
_exception
_tracebackc                V    || _         || _        ||j                  | _        yd| _        y:meta private:Nr   r   __traceback__r   )selfresult	exceptions      r   __init__zResult.__init__   s+     #5>5J)11PTr   c                P    | j                   }|yt        |      || j                  fS r   )r   typer   )r    excs     r   excinfozResult.excinfo*   s*     oo;IsDOO44r   c                    | j                   S )r   )r   )r    s    r   r"   zResult.exception3   s     r   c                `    d}dx}}	  |       } | ||      S # t         $ r}|}Y d}~d}~ww xY w)r   TN)BaseException)clsfunc__tracebackhide__r!   r"   r&   s         r   	from_callzResult.from_call8   sF     !!!	VF 69%%  	I	s    	-(-c                .    || _         d| _        d| _        y)a,  Force the result(s) to ``result``.

        If the hook was marked as a ``firstresult`` a single value should
        be set, otherwise set a (modified) list of results. Any exceptions
        found during invocation will be deleted.

        This overrides any previous result or exception.
        Nr   )r    r!   s     r   force_resultzResult.force_resultC   s     r   c                V    d| _         || _        ||j                  | _        yd| _        y)zForce the result to fail with ``exception``.

        This overrides any previous result or exception.

        .. versionadded:: 1.1.0
        Nr   )r    r"   s     r   force_exceptionzResult.force_exceptionP   s+     #5>5J)11PTr   c                    d}| j                   }| j                  }|t        t        | j                        S |j                  |      )zGet the result(s) for this hook call.

        If the hook was marked as a ``firstresult`` only a single value
        will be returned, otherwise a list of results.
        T)r   r   r   r   r   with_traceback)r    r-   r&   tbs       r   
get_resultzResult.get_result[   sC     !oo__;
DLL11$$R((r   N)r!   zResultType | Noner"   BaseException | NonereturnNone)r8   z_ExcInfo | None)r8   r7   )r,   zCallable[[], ResultType]r8   zResult[ResultType])r!   r   r8   r9   )r"   r*   r8   r9   )r8   r   )r   r   r   r   	__slots__r#   propertyr'   r"   classmethodr.   r0   r2   r6   r   r   r   r   r      s     8I	U!	U (	U 
		U 5 5   & &	U)r   r   N)r   
__future__r   typesr   typingr   r   r   r   r	   r
   tupler%   r*   _ExcInfor   	Exceptionr   r   _Resultr   r   r   <module>rD      s    #        m$mXm5LLM\"
'I ' N)WZ  N) N)d r   