Skip to content
Myr

remove deprecated Markup and escape aliases

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by David Lord · parent c6caa4c · Browse files · 3 files+1 added−24 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+1 added−24 removed

  • other:+1 added−24 removed

3 files+1 added−24 removed

modified:src/jinja2/__init__.py-2 removed
26 unmodified lines
27from .runtime import make_logging_undefined as make_logging_undefined28from .runtime import StrictUndefined as StrictUndefined29from .runtime import Undefined as Undefined30from .utils import clear_caches as clear_caches31from .utils import escape31from .utils import is_undefined as is_undefined33from .utils import Markup32from .utils import pass_context as pass_context33from .utils import pass_environment as pass_environment34from .utils import pass_eval_context as pass_eval_context35from .utils import select_autoescape as select_autoescape
2 unmodified lines
modified:src/jinja2/utils.py-22 removed
1 unmodified line
2import json3import os4import re5import typing as t6import warnings6from collections import abc7from collections import deque8from random import choice9from random import randrange
754 unmodified lines
764 self.__attrs[name] = value765766 def __repr__(self) -> str:767 return f"<Namespace {self.__attrs!r}>"769770771class Markup(markupsafe.Markup):772 def __new__(cls, base="", encoding=None, errors="strict"): # type: ignore773 warnings.warn(774 "'jinja2.Markup' is deprecated and will be removed in Jinja"775 " 3.1. Import 'markupsafe.Markup' instead.",776 DeprecationWarning,777 stacklevel=2,778 )779 return super().__new__(cls, base, encoding, errors)780781782def escape(s: t.Any) -> str:783 warnings.warn(784 "'jinja2.escape' is deprecated and will be removed in Jinja"785 " 3.1. Import 'markupsafe.escape' instead.",786 DeprecationWarning,787 stacklevel=2,788 )789 return markupsafe.escape(s)
modified:CHANGES.rst+1 added
12 unmodified lines
13 ``pass_context``. ``evalcontextfilter`` and14 ``evalcontextfunction`` are replaced by ``pass_eval_context``.15 ``environmentfilter`` and ``environmentfunction`` are replaced16 by ``pass_environment``.17 - ``Markup`` and ``escape`` should be imported from MarkupSafe.181920Version 3.0.321-------------
911 unmodified lines