U
    Òøïcu  ã                   @   s0   d dl Z d dlZd dlZdd„ Zee deƒZdS )é    Nc                 Ï   s8   t  ¡ }t ¡ }tj|j| f|ž|Ž}| d|¡I dH S )a„  Asynchronously run function *func* in a separate thread.
    Any *args and **kwargs supplied for this function are directly passed
    to *func*. Also, the current :class:`contextvars.Context` is propagated,
    allowing context variables from the main thread to be accessed in the
    separate thread.
    Return a coroutine that can be awaited to get the eventual result of *func*.
    N)ÚasyncioZget_running_loopÚcontextvarsZcopy_contextÚ	functoolsÚpartialÚrunZrun_in_executor)ÚfuncÚargsÚkwargsZloopÚctxZ	func_call© r   úI/tmp/pip-unpacked-wheel-rwcmptg8/pyhanko_certvalidator/_asyncio_compat.pyÚ
_to_thread   s    r   Ú	to_thread)r   r   r   r   Úgetattrr   r   r   r   r   Ú<module>   s   	