Format: application/x-python-code
⬇ Download File (1.4 KB)
   1  o
   2  
   3  -hF�@s0ddlZddlmZdd�Zdd�Zdd	�ZdS)
   4  �N�)�iscoroutinefunctioncCsPt|dd�rdSt|dd�rdSt�|�rdSt|d�r#t|j�r#dSt|�S)zY
   5      Tests to see if an application is a legacy-style (double-callable) application.
   6      Z_asgi_single_callableFZ_asgi_double_callableT�__call__)�getattr�inspect�isclass�hasattrrr��application�r�KC:\Users\shubh\Videos\agent\nova\Lib\site-packages\asgiref/compatibility.py�is_double_callables
   7  
   8  
   9  
  10  r
  11  cs�fdd�}|S)zS
  12      Transforms a double-callable ASGI application into a single-callable one.
  13      c�s��|�}|||�IdHS)Nr)�scopeZreceive�send�instancer	rr�new_application!s�z2double_to_single_callable.<locals>.new_applicationr)r
  14  rrr	r�double_to_single_callablesrcCst|�rt|�}|S)z�
  15      Takes either a single- or double-callable application and always returns it
  16      in single-callable style. Use this to add backwards compatibility for ASGI
  17      2.0 applications to your server/test harness/etc.
  18      )r
  19  rr	rrr�guarantee_single_callable(sr)rZsyncrr
  20  rrrrrr�<module>s
  21