From f562a4fdea7bc10039ffa555367f8891e790ab53 Mon Sep 17 00:00:00 2001 From: David Lord Date: Mon, 17 May 2021 06:41:42 -0700 Subject: fix deprecated `Markup` subclass --- CHANGES.rst | 2 ++ src/jinja2/utils.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index b183522..a371b22 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -11,6 +11,8 @@ Unreleased - Fix some types that weren't available in Python 3.6.0. :issue:`1433` - The deprecation warning for unneeded ``autoescape`` and ``with_`` extensions shows more relevant context. :issue:`1429` +- Fixed calling deprecated ``jinja2.Markup`` without an argument. + Use ``markupsafe.Markup`` instead. :issue:`1438` Version 3.0.0 diff --git a/src/jinja2/utils.py b/src/jinja2/utils.py index 8531174..2a2641c 100644 --- a/src/jinja2/utils.py +++ b/src/jinja2/utils.py @@ -834,7 +834,7 @@ class Namespace: class Markup(markupsafe.Markup): - def __new__(cls, base, encoding=None, errors="strict"): # type: ignore + 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.", -- cgit v1.2.1