File manager - Edit - /usr/local/CyberPanel/lib/python3.10/site-packages/django/utils/__pycache__/deprecation.cpython-310.pyc
Back
o �hm � @ s� d dl Z d dlZd dlmZmZmZ G dd� de�ZG dd� de�Z eZ e ZG dd� d�ZG d d � d e �ZG dd� de �ZG d d� d�ZdS )� N)�iscoroutinefunction�markcoroutinefunction� sync_to_asyncc @ � e Zd ZdS )�RemovedInDjango50WarningN��__name__� __module__�__qualname__� r r �N/usr/local/CyberPanel/lib/python3.10/site-packages/django/utils/deprecation.pyr � r c @ r )�RemovedInDjango51WarningNr r r r r r r r c @ s e Zd Zdd� Zdd� ZdS )�warn_about_renamed_methodc C s || _ || _|| _|| _d S )N)� class_name�old_method_name�new_method_name�deprecation_warning)�selfr r r r r r r �__init__ s z"warn_about_renamed_method.__init__c s � �fdd�}|S )Nc s. t �d�j�j�jf �jd� � | i |��S )Nz(`%s.%s` is deprecated, use `%s` instead.� )�warnings�warnr r r r )�args�kwargs��fr r r �wrapper s ��z3warn_about_renamed_method.__call__.<locals>.wrapperr )r r r r r r �__call__ s z"warn_about_renamed_method.__call__N)r r r r r r r r r r s r c s$ e Zd ZdZdZ� fdd�Z� ZS )�RenameMethodsBasea# Handles the deprecation paths when renaming a method. It does the following: 1) Define the new method if missing and complain about it. 2) Define the old method if missing. 3) Complain whenever an old method is called. See #15363 for more details. r c s� t � �| |||�}t�|�D ]U}|j}| jD ]L}|d }|j�|�} |d } |j�| �}|d }t|g|�R � } |sV| rVt � d||| f |d� t|| | � t||| | �� | sb|rbt||| |�� qq|S )Nr � r z&`%s.%s` method should be renamed `%s`.)�super�__new__�inspect�getmror �renamed_methods�__dict__�getr r r �setattr)�cls�name�bases�attrs� new_class�baser �renamed_methodr � old_methodr � new_methodr r �� __class__r r r"