a
    dz                     @   s    d Z G dd deZdd ZdS )z7Simple and tiny yield-based trampoline implementation.
c                   @   s   e Zd ZdZdd ZdS )TailCallz-Raised to signal a tail call to trampoline().c                 C   s
   || _ d S )N)call)selfr    r   \/var/www/html/stable-diffusion-webui/venv/lib/python3.9/site-packages/trampoline/__init__.py__init__   s    zTailCall.__init__N)__name__
__module____qualname____doc__r   r   r   r   r   r      s   r   c              
   C   s  | g}d}d}|rz^|dur8|d }}|d  |}n.|du rNt|d }n|d }}|d |}|| W q ty } z|  |j}W Y d}~qd}~0  ty } z|j|d< W Y d}~qd}~0  t	y  } z|  |}W Y d}~qd}~0 0 q|dur||S )z3Invoke a generator for a trampolined function call.N)
thrownextsendappendStopIterationpopvaluer   r   BaseException)r   stackretval	exceptionexresr   er   r   r   
trampoline   s0    


r   N)r
   r   r   r   r   r   r   r   <module>   s   