]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
remove deprecated Markup and escape aliases
authorDavid Lord <davidism@gmail.com>
Tue, 9 Nov 2021 20:44:30 +0000 (12:44 -0800)
committerDavid Lord <davidism@gmail.com>
Wed, 10 Nov 2021 19:07:04 +0000 (11:07 -0800)
CHANGES.rst
src/jinja2/__init__.py
src/jinja2/utils.py

index 5bb8e9f9c3f591a57c7f885766be81b72aeaafeb..35dcd78ef88068aeca2cb79abba555540137deac 100644 (file)
@@ -14,6 +14,7 @@ Unreleased
         ``evalcontextfunction`` are replaced by ``pass_eval_context``.
         ``environmentfilter`` and ``environmentfunction`` are replaced
         by ``pass_environment``.
+    -   ``Markup`` and ``escape`` should be imported from MarkupSafe.
 
 
 Version 3.0.3
index ebac17689c415ead6225c4820a63aa426838635b..f2499c7fea799136ed82b4c1958c238c60619d66 100644 (file)
@@ -28,9 +28,7 @@ from .runtime import make_logging_undefined as make_logging_undefined
 from .runtime import StrictUndefined as StrictUndefined
 from .runtime import Undefined as Undefined
 from .utils import clear_caches as clear_caches
-from .utils import escape
 from .utils import is_undefined as is_undefined
-from .utils import Markup
 from .utils import pass_context as pass_context
 from .utils import pass_environment as pass_environment
 from .utils import pass_eval_context as pass_eval_context
index 976cf711ae4a75b5f062b7d1a5ca21f76540b355..30206c509c2eb6af67ee38b330949beaaeb7c5d3 100644 (file)
@@ -3,7 +3,6 @@ import json
 import os
 import re
 import typing as t
-import warnings
 from collections import abc
 from collections import deque
 from random import choice
@@ -766,24 +765,3 @@ class Namespace:
 
     def __repr__(self) -> str:
         return f"<Namespace {self.__attrs!r}>"
-
-
-class Markup(markupsafe.Markup):
-    def __new__(cls, base="", encoding=None, errors="strict"):  # type: ignore
-        warnings.warn(
-            "'jinja2.Markup' is deprecated and will be removed in Jinja"
-            " 3.1. Import 'markupsafe.Markup' instead.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-        return super().__new__(cls, base, encoding, errors)
-
-
-def escape(s: t.Any) -> str:
-    warnings.warn(
-        "'jinja2.escape' is deprecated and will be removed in Jinja"
-        " 3.1. Import 'markupsafe.escape' instead.",
-        DeprecationWarning,
-        stacklevel=2,
-    )
-    return markupsafe.escape(s)