``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
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
import os
import re
import typing as t
-import warnings
from collections import abc
from collections import deque
from random import choice
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)