From: David Lord Date: Mon, 17 May 2021 13:41:42 +0000 (-0700) Subject: fix deprecated `Markup` subclass X-Git-Tag: 3.0.1~3^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1440%2Fhead;p=thirdparty%2Fjinja.git fix deprecated `Markup` subclass --- diff --git a/CHANGES.rst b/CHANGES.rst index b1835228..a371b226 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 85311747..2a2641c0 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.",