summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/util/deprecations.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/util/deprecations.py')
-rw-r--r--lib/sqlalchemy/util/deprecations.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/sqlalchemy/util/deprecations.py b/lib/sqlalchemy/util/deprecations.py
index 83037bbff..9f0ca0b1a 100644
--- a/lib/sqlalchemy/util/deprecations.py
+++ b/lib/sqlalchemy/util/deprecations.py
@@ -162,9 +162,17 @@ def moved_20(message, **kw):
def deprecated_20(api_name, alternative=None, **kw):
+ type_reg = re.match("^:(attr|func|meth):", api_name)
+ if type_reg:
+ type_ = {"attr": "attribute", "func": "function", "meth": "method"}[
+ type_reg.group(1)
+ ]
+ else:
+ type_ = "construct"
message = (
- "The %s function/method is considered legacy as of the "
- "1.x series of SQLAlchemy and will be removed in 2.0." % api_name
+ "The %s %s is considered legacy as of the "
+ "1.x series of SQLAlchemy and will be removed in 2.0."
+ % (api_name, type_)
)
if alternative: