File: //home/arjun/projects/env/lib/python3.10/site-packages/pluggy/__pycache__/_callers.cpython-310.pyc
o
weY � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z d d
l
mZ d dlm
Z
d dlmZ d d
lmZ e eedee df edeef f Zddd�ZdS )z
Call loop machinery
� )�annotations)�cast)� Generator)�Mapping)�Sequence)�Tuple)�Union� )�HookImpl)�_raise_wrapfail)�
HookCallError)�ResultN� hook_name�str�
hook_impls�Sequence[HookImpl]�
caller_kwargs�Mapping[str, object]�firstresult�bool�return�object | list[object]c s� d}g }d}d}�z�g }z�t |�D ]�} z� fdd�| jD �}
W n ty9 | jD ]
}|� vr6td|����q)Y nw | jrkd}z| j|
� }ttdtt df |�}
t
|
� |�|
f� W q tyj t
|
d� Y qw | jr�z| j|
� }ttdt t f |�}t
|� |�|� W q ty� t
|d� Y qw | j|
� }|dur�|�|� |r� nqW n ty� } z|}W Y d}~nd}~ww W |�r,|r�|r�|d nd}n|}t |�D ]I}z|dur�|�|� n|�|� |�� W n, t�y } z|j}d}W Y d}~q�d}~w t�y } z|}W Y d}~q�d}~ww t
|d � q�|du�r*|�|j��|S |�r<t|�r7|d nd|�}nt||�}t |�D ]w}t|t��rjz|d �|� t
|d d � W �qE t�yi Y �qEw z|jdu�rx|�|j� n|�|j� |�� W n2 t�y� } z
|�|j� W Y d}~�qEd}~w t�y� } z|�|� W Y d}~�qEd}~ww t
|d � �qE|�� S |�r8|�r�|�r�|d nd}n|}t |�D ]M}z|du�r�|�|� n|�|� |�� W n. t�y } z|j}d}W Y d}~�q�d}~w t�y } z |}W Y d}~�q�d}~ww t
|d � �q�|du�r0|�|j��| Y S |�rHt|�rC|d nd|�}nt||�}t |�D ]w}t|t��rvz|d �|� t
|d d � W �qQ t�yu Y �qQw z|jdu�r�|�|j� n|�|j� |�� W n2 t�y� } z
|�|j� W Y d}~�qQd}~w t�y� } z|�|� W Y d}~�qQd}~ww t
|d � �qQ|�� Y S )
z�Execute a call into multiple python functions/methods and return the
result(s).
``caller_kwargs`` comes from HookCaller.__call__().
TNc s g | ]}� | �qS � r )�.0�argname�r r �H/home/arjun/projects/env/lib/python3.10/site-packages/pluggy/_callers.py�
<listcomp>/ s z_multicall.<locals>.<listcomp>z hook call must provide argument Fz
did not yieldr zhas second yield)�reversed�argnames�KeyErrorr �hookwrapper�functionr r r
�object�next�append�
StopIterationr �wrapper�
BaseException�throw�send�close�value�with_traceback�
__traceback__�
isinstance�tuple�
_exception�_result�force_result�force_exception�
get_result)r r r r �__tracebackhide__�results� exception�only_new_style_wrappers� teardowns� hook_impl�argsr �res�wrapper_gen�function_gen�exc�result�teardown�si�e�outcomer r r �
_multicall s6
����
�
�
����
���
�
��
���
���
�
��
��rF )
r r r r r r r r r r )�__doc__�
__future__r �typingr r r r r r �_hooksr
r2 r r r
r# �TeardownrF r r r r �<module> s$ ��