U
    Ü¦—\b  ã                   @   s    d dl Z dd„ Zefdd„ZdS )é    Nc                    s   ‡ fdd„}t  ˆ ¡|ƒS )a6  
    Decorate func so it's only ever called the first time.

    This decorator can ensure that an expensive or non-idempotent function
    will not be expensive on subsequent calls and is idempotent.

    >>> func = once(lambda a: a+3)
    >>> func(3)
    6
    >>> func(9)
    6
    >>> func('12')
    6
    c                     s   t ˆ dƒsˆ | |Žˆ _ˆ jS )NÚalways_returns)Úhasattrr   )ÚargsÚkwargs©Úfunc© ú7/usr/lib/python3/dist-packages/keyring/util/__init__.pyÚwrapper   s    
zonce.<locals>.wrapper)Ú	functoolsÚwraps)r   r
   r   r   r	   Úonce   s    r   c              	   c   s0   | D ]&}z|ƒ V  W q |k
r(   Y qX qdS )zk
    yield the results of calling each element of callables, suppressing
    any indicated exceptions.
    Nr   )Z	callablesÚ
exceptionsÚcallabler   r   r	   Úsuppress_exceptions   s
    r   )r   r   Ú	Exceptionr   r   r   r   r	   Ú<module>   s   