Server : Apache System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64 User : dh_edsupp ( 6597262) PHP Version : 8.2.26 Disable Function : NONE Directory : /lib/python3/dist-packages/asgiref/__pycache__/ |
Upload File : |
o �6�a> � @ s, d dl Z d dlZdd� Zdd� Zdd� ZdS )� Nc C sT t | dd�rdS t | dd�rdS t�| �rdS t| d�r$t�| j�r$dS t�| � S )zY Tests to see if an application is a legacy-style (double-callable) application. �_asgi_single_callableF�_asgi_double_callableT�__call__)�getattr�inspect�isclass�hasattr�asyncio�iscoroutinefunctionr ��application� r �7/usr/lib/python3/dist-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 )�scope�receive�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'