diff mercurial/templatefilters.py @ 34695:e178fcaa3933

python3: use our bytes-only version of cgi.escape everywhere As suggested by Yuya in D965. Differential Revision: https://phab.mercurial-scm.org/D1067
author Augie Fackler <augie@google.com>
date Thu, 05 Oct 2017 14:16:20 -0400
parents 0fa781320203
children 4fdc4adbc838
line wrap: on
line diff
--- a/mercurial/templatefilters.py	Sat Oct 14 02:57:26 2017 -0400
+++ b/mercurial/templatefilters.py	Thu Oct 05 14:16:20 2017 -0400
@@ -7,7 +7,6 @@
 
 from __future__ import absolute_import
 
-import cgi
 import os
 import re
 import time
@@ -19,6 +18,7 @@
     pycompat,
     registrar,
     templatekw,
+    url,
     util,
 )
 
@@ -128,7 +128,7 @@
     """Any text. Replaces the special XML/XHTML characters "&", "<"
     and ">" with XML entities, and filters out NUL characters.
     """
-    return cgi.escape(text.replace('\0', ''), True)
+    return url.escape(text.replace('\0', ''), True)
 
 para_re = None
 space_re = None