관리-도구
편집 파일: asyncbackend.cpython-39.pyc
a �����M�e� ����������������������@���s����U�d�dl�mZ�d�dlZd�dlmZmZmZmZ�da i�Z eeef�ed<�dZ G�dd��dejj�Zeed�d d �Zed�dd �Zed�dd�Zeed�dd�ZdS�)�����)�DictN)�Backend�DatagramSocket�Socket�StreamSocket� _backendsFc�������������������@���s���e�Zd�ZdS�)�AsyncLibraryNotFoundErrorN)�__name__� __module__�__qualname__��r���r����4/usr/lib/python3.9/site-packages/dns/asyncbackend.pyr������s���r���)�name�returnc�����������������C���sd���t��|��}|r|S�|�dkr.ddl}|j���}n*|�dkrJddl}|j���}ntd|������|t�|�<�|S�)z�Get 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. Ztrior���N�asynciozunimplemented async backend )r����getZdns._trio_backendZ _trio_backendr���Zdns._asyncio_backendZ_asyncio_backend�NotImplementedError)r���Zbackend�dnsr���r���r ����get_backend���s���� r���)r���c������������������C���s����z>t�r t�ddl}�z|����W�W�S��|�jy:���td��Y�n0�W�nF�ty����ddl}z|����W�Y�dS��ty~���td��Y�n0�Y�n0�dS�)z�Attempt 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���zno async library detected)�_no_sniffio�ImportError�sniffioZcurrent_async_libraryr���r���Zget_running_loop�RuntimeError)r���r���r���r���r ����sniff7���s����r���c�������������������C���s���t�rt�S�tt���S�)z6Get the default backend, initializing it if necessary.)�_default_backend�set_default_backendr���r���r���r���r ����get_default_backendR���s����r���c�����������������C���s���t�|��atS�)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���r���r���r ���r���Z���s���� r���)�typingr���Z dns.exceptionr���Zdns._asyncbackendr���r���r���r���r���r����str�__annotations__r���� exceptionZDNSExceptionr���r���r���r���r���r���r���r���r ����<module>���s���