HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/CyberCP/lib/python3.10/site-packages/django/utils/__pycache__/asyncio.cpython-310.pyc
o

�hf�@sxddlZddlmZddlmZddlmZdd�Zz	ddlm	Z	WdSe
y;ddlmZGd	d
�d
e�Z	YdSw)�N)�get_running_loop��wraps)�SynchronousOnlyOperationcs(�fdd�}t��r�}d�||�S|S)z�
    Decorator to mark functions as async-unsafe. Someone trying to access
    the function while in an async context will get an error message.
    cst����fdd��}|S)Ncs@zt�Wn	tyYnwtj�d�st����|i|��S)N�DJANGO_ALLOW_ASYNC_UNSAFE)r�RuntimeError�os�environ�getr)�args�kwargs)�func�message��G/usr/local/CyberCP/lib/python3.10/site-packages/django/utils/asyncio.py�inners
�z.async_unsafe.<locals>.decorator.<locals>.innerr)r
r�r)r
r�	decoratorszasync_unsafe.<locals>.decoratorzKYou cannot call this from an async context - use a thread or sync_to_async.)�callable)rrr
rrr�async_unsafes�r)�aclosing)�AbstractAsyncContextManagerc@s(eZdZdZdd�Zdd�Zdd�ZdS)	rz�
        Async context manager for safely finalizing an asynchronously
        cleaned-up resource such as an async generator, calling its
        ``aclose()`` method.
        cCs
||_dS�N��thing)�selfrrrr�__init__9s
zaclosing.__init__c�s�|jSrr)rrrr�
__aenter__<s�zaclosing.__aenter__c�s�|j��IdHdSr)r�aclose)r�exc_inforrr�	__aexit__?s�zaclosing.__aexit__N)�__name__�
__module__�__qualname__�__doc__rrr rrrrr2s
r)r�asyncior�	functoolsr�django.core.exceptionsrr�
contextlibr�ImportErrorrrrrr�<module>s"�