B
    GFFb1  ã               @   s,   d Z ddlZddlmZmZmZ dd„ ZdS )z
Call loop machinery
é    Né   )ÚHookCallErrorÚ_ResultÚ_raise_wrapfailc                s€  d}g }d}züg }yÔxÎt |ƒD ]Â}y‡ fdd„|jD ƒ}	W n: tk
rt   x$|jD ]}
|
ˆ krRtd|
›ƒ‚qRW Y nX |jr¾y |j|	Ž }t|ƒ | |¡ W qà tk
rº   t	|dƒ Y qàX q|j|	Ž }|dk	r| |¡ |rP qW W n t
k
r   t ¡ }Y nX W d|r*t|r |d nd|ƒ}n
t||ƒ}xBt |ƒD ]6}y| |¡ t	|dƒ W n tk
rp   Y nX q>W | ¡ S )	z’Execute a call into multiple python functions/methods and return the
    result(s).

    ``caller_kwargs`` comes from _HookCaller.__call__().
    TNc                s   g | ]}ˆ | ‘qS © r   )Ú.0Úargname)Úcaller_kwargsr   ú.lib/python3.7/site-packages/pluggy/_callers.pyú
<listcomp>   s    z_multicall.<locals>.<listcomp>z hook call must provide argument zdid not yieldr   zhas second yield)ÚreversedZargnamesÚKeyErrorr   ZhookwrapperZfunctionÚnextÚappendÚStopIterationr   ÚBaseExceptionÚsysÚexc_infor   ÚsendZ
get_result)Z	hook_nameZ
hook_implsr	   ZfirstresultZ__tracebackhide__ZresultsÚexcinfoZ	teardownsZ	hook_implÚargsr   ÚgenZresZoutcomer   )r	   r
   Ú
_multicall	   sL    





r   )Ú__doc__r   Z_resultr   r   r   r   r   r   r   r
   Ú<module>   s   