← Back
Editing: asyncio.cpython-311.pyc
� �|�e$ � �^ � d dl Z d dlZd dlZd dlmZ d dlmZ ere j Zne j Zd� Z dS )� N)�SynchronousOnlyOperation)�PY37c �N � � � fd�}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. c �J �� � t j � � � � �fd�� � }|S )Nc �� �� t j � d� � sJ t � � }t s|� � � rt �� � �n# t $ r Y nw xY w �| i |��S )N�DJANGO_ALLOW_ASYNC_UNSAFE)�os�environ�get�get_running_loopr � is_runningr �RuntimeError)�args�kwargs� event_loop�func�messages ���6/usr/lib/python3/dist-packages/django/utils/asyncio.py�innerz.async_unsafe.<locals>.decorator.<locals>.inner s� �� ��:�>�>�"=�>�>� @�@�!1�!3�!3�J� � @�z�4�4�6�6� @�6�w�?�?�?�@�� $� � � ��D����� �4��(��(�(�(s �A � A(�'A()� functools�wraps)r r r s ` �r � decoratorzasync_unsafe.<locals>.decorator s>