Merge pull request #1439 from pallets/deprecated-markup

fix deprecated `Markup` subclass
This commit is contained in:
David Lord 2021-05-17 06:45:26 -07:00 committed by GitHub
commit ab7840328f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -17,6 +17,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

View File

@ -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.",