Ë
    $Æ%h  ã                   óš   — d dl mZ d dlmZ d dlZd dlZ edd¬«      Z G d„ dej                  «      Z e«       Z	 G d„ d	e
«      Zd
efd„Zy)é    )Ú
ContextVar)ÚOptionalNÚcurrent_async_library_cvar)Údefaultc                   ó   — e Zd ZdZy)Ú_ThreadLocalN)Ú__name__Ú
__module__Ú__qualname__Úname© ó    úK/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/sniffio/_impl.pyr   r      s	   „ ð �Dr   r   c                   ó   — e Zd Zy)ÚAsyncLibraryNotFoundErrorN)r	   r
   r   r   r   r   r   r      s   „ Ør   r   Úreturnc                  ór  — t         j                  } | �| S t        j                  «       } | �| S dt        j
                  v rddl}	 |j                  }	  |«       �y	 dt        j
                  v rddlm}  |«       ryt        d«      ‚# t        $ r |j                  j                  }Y ŒVw xY w# t        $ r Y Œ[w xY w)ae  Detect which async library is currently running.

    The following libraries are currently supported:

    ================   ===========  ============================
    Library             Requires     Magic string
    ================   ===========  ============================
    **Trio**            Trio v0.6+   ``"trio"``
    **Curio**           -            ``"curio"``
    **asyncio**                      ``"asyncio"``
    **Trio-asyncio**    v0.8.2+     ``"trio"`` or ``"asyncio"``,
                                    depending on current mode
    ================   ===========  ============================

    Returns:
      A string like ``"trio"``.

    Raises:
      AsyncLibraryNotFoundError: if called from synchronous context,
        or if the current async library was not recognized.

    Examples:

        .. code-block:: python3

           from sniffio import current_async_library

           async def generic_sleep(seconds):
               library = current_async_library()
               if library == "trio":
                   import trio
                   await trio.sleep(seconds)
               elif library == "asyncio":
                   import asyncio
                   await asyncio.sleep(seconds)
               # ... and so on ...
               else:
                   raise RuntimeError(f"Unsupported library {library!r}")

    NÚasyncior   Úcurio)Úcurio_runningz.unknown async library, or not in async context)Úthread_localr   r   ÚgetÚsysÚmodulesr   Úcurrent_taskÚAttributeErrorÚTaskÚRuntimeErrorÚ
curio.metar   r   )Úvaluer   r   r   s       r   Úcurrent_async_libraryr!      sÆ   € ôR ×Ñ€EØÐØˆä&×*Ñ*Ó,€EØÐØˆð ”C—K‘KÑÛð	5Ø"×/Ñ/ˆLð	Ù‹~Ð)Ø ð *ð ”#—+‘+ÑÝ,ÙŒ?Øä
#Ø8óð øô ò 	5Ø"Ÿ<™<×4Ñ4ŠLð	5ûô
 ò 	Ùð	ús$   ÁB ÁB* ÂB'Â&B'Â*	B6Â5B6)Úcontextvarsr   Útypingr   r   Ú	threadingr   Úlocalr   r   r   r   Ústrr!   r   r   r   ú<module>r'      sT   ðÝ "Ý Û 
Û á'Ø ¨$ôÐ ô
�9—?‘?ô ñ ‹~€ô	 ô 	ðF˜sô Fr   