HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib/python3.10/site-packages/pluggy/__pycache__/_result.cpython-310.pyc
o

we��@s�dZddlmZddlmZddlmZddlmZddlmZddlm	Z	ddlm
Z
dd	lmZdd
lmZddlm
Z
ddlmZdd
lmZe
eeeeefZed�Zddd�ZGdd�de�ZeGdd�de
e��ZeZdS)z"
Hook wrapper "result" utilities.
�)�annotations)�
TracebackType)�Callable)�cast)�final)�	Generator)�Generic)�NoReturn)�Optional)�Tuple)�Type)�TypeVar�
ResultType�wrap_controller�KGenerator[None, Result[ResultType], None] | Generator[None, object, object]�msg�str�returnr	cCs |j}td|j|j|j|f��)Nzwrap_controller at %r %s:%d %s)�gi_code�RuntimeError�co_name�co_filename�co_firstlineno)rr�co�r�G/home/arjun/projects/env/lib/python3.10/site-packages/pluggy/_result.py�_raise_wrapfails��rc@seZdZdZdS)�
HookCallErrorzHook was called incorrectly.N)�__name__�
__module__�__qualname__�__doc__rrrrr$src@sfeZdZdZdZdd	d
�Zeddd
��Zed dd��Ze	d!dd��Z
d"dd�Zd#dd�Zd$dd�Z
dS)%�ResultzYAn object used to inspect and set the result in a :ref:`hook wrapper
    <hookwrappers>`.��_result�
_exception�result�ResultType | None�	exception�BaseException | Noner�NonecCs||_||_dS��:meta private:Nr#)�selfr&r(rrr�__init__/s
zResult.__init__�_ExcInfo | NonecCs"|j}|dur	dSt|�||jfSr+)r%�type�
__traceback__)r-�excrrr�excinfo8szResult.excinfocCs|jS)r,)r%)r-rrrr(AszResult.exception�func�Callable[[], ResultType]�Result[ResultType]c
CsJd}d}}z|�}Wnty}z|}WYd}~nd}~ww|||�S)r,TN)�
BaseException)�clsr4�__tracebackhide__r&r(r2rrr�	from_callFs
��
zResult.from_callrcCs||_d|_dS)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&rrr�force_resultQs	
zResult.force_resultr7cCsd|_||_dS)z�Force the result to fail with ``exception``.

        This overrides any previous result or exception.

        .. versionadded:: 1.1.0
        Nr#)r-r(rrr�force_exception]s
zResult.force_exceptioncCs*d}|j}|durtt|j�S|�|j��)z�Get 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.
        TN)r%rrr$�with_tracebackr1)r-r9r2rrr�
get_resultgs
zResult.get_resultN)r&r'r(r)rr*)rr/)rr))r4r5rr6)r&rrr*)r(r7rr*)rr)rrr r!�	__slots__r.�propertyr3r(�classmethodr:r;r<r>rrrrr"(s
	



r"N)rrrrrr	)r!�
__future__r�typesr�typingrrrrrr	r
rrr
r7�_ExcInforr�	Exceptionrr"�_Resultrrrr�<module>s(

M