관리-도구
편집 파일: deprecations.cpython-37.pyc
B ��4]� � @ s� d Z ddlZddlZddlmZ ddlmZ ddlmZ ddlmZ dd lm Z d!dd�Z d"d d�Zd#dd�Zd$dd�Z dd� Zd%dd�Zdd� Zdd� Zd&dd�Zd'dd �ZdS )(zSHelpers related to deprecation of functions, methods, classes, other functionality.� N� )�compat)� decorator)�inject_docstring_text)�inject_param_text� )�exc� c C s t j| tj|d� d S )N)� stacklevel)�warnings�warnr �SADeprecationWarning)�msgr � r �O/opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/util/deprecations.py�warn_deprecated s r c C s t j| tj|d� d S )N)r )r r r �SAPendingDeprecationWarning)r r r r r �warn_pending_deprecation s r �__init__c s$ d| �p df �� ��fdd�}|S )Nz.. deprecated:: %s %s� c s t | � tj�t� d� ��S )N)�func)�_decorate_cls_with_warningr r �dict)�cls)�constructor�header�messager r �decorate s z deprecated_cls.<locals>.decorater )�versionr r r r )r r r r �deprecated_cls s r Tc s8 |rd| �pdf � nd� �dkr&d�� �fdd�}|S )a� Decorates a function and issues a deprecation warning on use. :param version: Issue version in the warning. :param message: If provided, issue message in the warning. A sensible default is used if not provided. :param add_deprecation_to_docstring: Default True. If False, the wrapped function's __doc__ is left as-is. If True, the 'message' is prepended to the docs if provided, or sensible default if message is omitted. z.. deprecated:: %s %sr Nz$Call to deprecated function %(func)sc s t | tj�t| jd� � �S )N)r )�_decorate_with_warningr r r �__name__)�fn)r r r r r E s zdeprecated.<locals>.decorater )r r �add_deprecation_to_docstringr r )r r r � deprecated, s r$ c s<