
    Eqg
                         U d dl mZ d dlZd dlmZmZmZmZ da	i Z
eeef         ed<   dZ G d dej        j                  Zded	efd
Zd	efdZd	efdZded	efdZdS )    )DictN)BackendDatagramSocketSocketStreamSocket	_backendsFc                       e Zd ZdS )AsyncLibraryNotFoundErrorN)__name__
__module____qualname__     B/var/www/html/env/lib/python3.11/site-packages/dns/asyncbackend.pyr
   r
      s        Dr   r
   namereturnc                 
   t                               |           }|r|S | dk    rddl}|j                                        }n6| dk    rddl}|j                                        }nt          d|            |t           | <   |S )zGet the specified asynchronous backend.

    *name*, a ``str``, the name of the backend.  Currently the "trio"
    and "asyncio" backends are available.

    Raises NotImplementedError if an unknown backend name is specified.
    trior   Nasynciozunimplemented async backend )r   getdns._trio_backend_trio_backendr   dns._asyncio_backend_asyncio_backendNotImplementedError)r   backenddnss      r   get_backendr      s     mmD!!G v~~    #++--			####&..00!"G"G"GHHHIdONr   c                     	 t           rt          ddl} 	 |                                 S # | j        $ r t	          d          w xY w# t          $ r: ddl}	 |                                 Y dS # t          $ r t	          d          w xY ww xY w)zAttempt to determine the in-use asynchronous I/O library by using
    the ``sniffio`` module if it is available.

    Returns the name of the library, or raises AsyncLibraryNotFoundError
    if the library cannot be determined.
    r   Nz&sniffio cannot determine async libraryr   zno async library detected)_no_sniffioImportErrorsniffiocurrent_async_libraryr
   r   get_running_loopRuntimeError)r"   r   s     r   sniffr&   7   s    I 		V002220 	V 	V 	V+,TUUU	V I I I	I$$&&&99 	I 	I 	I+,GHHH	IIs,   A ) AA B
A,,BB
c                  T    t           rt           S t          t                                S )z6Get the default backend, initializing it if necessary.)_default_backendset_default_backendr&   r   r   r   get_default_backendr*   R   s"      uww'''r   c                 .    t          |           at          S )a,  Set the default backend.

    It's not normally necessary to call this method, as
    ``get_default_backend()`` will initialize the backend
    appropriately in many cases.  If ``sniffio`` is not installed, or
    in testing situations, this function allows the backend to be set
    explicitly.
    )r   r(   )r   s    r   r)   r)   Z   s     #4((r   )typingr   dns.exceptionr   dns._asyncbackendr   r   r   r   r(   r   str__annotations__r    	exceptionDNSExceptionr
   r   r&   r*   r)   r   r   r   <module>r3      sD                           "	4W " " " 	 	 	 	 	 : 	 	 	c g    4Is I I I I6(W ( ( ( (c g      r   