Skip to content

Commit

Permalink
Merge pull request #1401 from pallets/deprecated-markup
Browse files Browse the repository at this point in the history
fix deprecated `Markup` subclass
  • Loading branch information
davidism committed Apr 18, 2021
2 parents d77a91b + e802be7 commit 38839c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/jinja2/utils.py
Expand Up @@ -833,14 +833,14 @@ def __repr__(self):


class Markup(markupsafe.Markup):
def __init__(self, *args, **kwargs):
def __new__(cls, base, encoding=None, errors="strict"):
warnings.warn(
"'jinja2.Markup' is deprecated and will be removed in Jinja"
" 3.1. Import 'markupsafe.Markup' instead.",
DeprecationWarning,
stacklevel=2,
)
super().__init__(*args, **kwargs)
return super().__new__(cls, base, encoding, errors)


def escape(s):
Expand Down

0 comments on commit 38839c7

Please sign in to comment.