OwlCyberSecurity - MANAGER
Edit File: compatibility.cpython-39.pyc
a ���eF � @ s0 d dl Z ddlmZ dd� Zdd� Zdd � ZdS ) � N� )�iscoroutinefunctionc C sP t | dd�rdS t | dd�r dS t�| �r.dS t| d�rFt| j�rFdS t| � S )zY Tests to see if an application is a legacy-style (double-callable) application. Z_asgi_single_callableFZ_asgi_double_callableT�__call__)�getattr�inspect�isclass�hasattrr r ��application� r �V/home/gouroczh/virtualenv/pat/3.9/lib/python3.9/site-packages/asgiref/compatibility.py�is_double_callable s r c s � fdd�}|S )zS Transforms a double-callable ASGI application into a single-callable one. c � s � | �}|||�I d H S )Nr )�scopeZreceive�send�instancer r r �new_application! s z2double_to_single_callable.<locals>.new_applicationr )r r r r r �double_to_single_callable s r c C s t | �rt| �} | S )z� Takes either a single- or double-callable application and always returns it in single-callable style. Use this to add backwards compatibility for ASGI 2.0 applications to your server/test harness/etc. )r r r r r r �guarantee_single_callable( s r )r �syncr r r r r r r r �<module> s