From b626c5a9798b045b655d085d59efdd60b5d7a0e3 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Mon, 21 Feb 2022 09:46:39 +0100 Subject: [PATCH] Removed unnecessary str type from @keep_lazy decorator for escape()/escapejs(). --- django/utils/html.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/utils/html.py b/django/utils/html.py index b6d6a01ce4..d0bc97be80 100644 --- a/django/utils/html.py +++ b/django/utils/html.py @@ -14,7 +14,7 @@ from django.utils.safestring import SafeData, SafeString, mark_safe from django.utils.text import normalize_newlines -@keep_lazy(str, SafeString) +@keep_lazy(SafeString) def escape(text): """ Return the given text with ampersands, quotes and angle brackets encoded @@ -46,7 +46,7 @@ _js_escapes = { _js_escapes.update((ord("%c" % z), "\\u%04X" % z) for z in range(32)) -@keep_lazy(str, SafeString) +@keep_lazy(SafeString) def escapejs(value): """Hex encode characters for use in JavaScript strings.""" return mark_safe(str(value).translate(_js_escapes))