o
    Ýîi¦
  ã                   @   sR   d Z ddlZe e¡ZddlmZ ddlmZ G dd„ de	ƒZ
dd„ Zd	d
„ ZdS )zžThe cooperative multitasking module. It includes the coroutine stuff.

This could have been named just coroutine.py if it wasn't for the coroutine
decorator.
é    N)Úchain©Úisgeneratorfunctionc                   @   s   e Zd ZdZdS )ÚBreakz<Raised for breaking out of infinite loops inside coroutines.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r
   r
   úQ/var/www/html/LicenciasMIG/venv/lib/python3.10/site-packages/spyne/util/coopmt.pyr   "   s    r   c                    ó   t ˆ ƒsJ ‚‡ fdd„}|S )Nc               
      s¸   z	ˆ | i |¤Ž}W n t y# } zt dˆ jˆ jˆ jj|¡ ‚ d }~ww zt|ƒ W |S  ty5   Y d S  t	y[ } zt
|dƒsVt d¡ t |¡ zd|_W ‚    Y ‚ ‚ d }~ww ©Nz!Function %r at %s:%d got error %rÚloggedzException in coroutineT)Ú	TypeErrorÚloggerÚerrorÚ	func_namer   Ú__code__Úco_firstlinenoÚnextÚStopIterationÚ	ExceptionÚhasattrÚ	exceptionr   )ÚargsÚkwargsÚretÚe©Úfuncr
   r   Ústart*   s4   
ÿ€ý
ò


ý€÷zcoroutine.<locals>.startr   ©r   r    r
   r   r   Ú	coroutine'   ó   r"   c                    r   )Nc               
      sÂ   z	ˆ | i |¤Ž}W n t y# } zt dˆ jˆ jˆ jj|¡ ‚ d }~ww zt|ƒ}W n0 ty4   Y d S  t	yZ } zt
|dƒsUt d¡ t |¡ zd|_W ‚    Y ‚ ‚ d }~ww t|f|ƒS r   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   )r   r   r   r   Úfirstr   r
   r   r    K   s4   
ÿ€ý


ý€÷zkeepfirst.<locals>.startr   r!   r
   r   r   Ú	keepfirstH   r#   r%   )r	   ÚloggingÚ	getLoggerr   r   Ú	itertoolsr   Úinspectr   r   r   r"   r%   r
   r
   r
   r   Ú<module>   s   
!