changeset 8189:02c119ae72e1

py3: use html.escape instead of cgi.escape DeprecationWarning: cgi.escape is deprecated, use html.escape instead
author Mads Kiilerich <mads@kiilerich.com>
date Wed, 25 Dec 2019 17:01:19 +0100
parents 22b40db44a41
children 08af13a090e0
files kallithea/controllers/error.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/error.py	Mon Nov 25 03:43:15 2019 +0100
+++ b/kallithea/controllers/error.py	Wed Dec 25 17:01:19 2019 +0100
@@ -25,7 +25,7 @@
 :license: GPLv3, see LICENSE.md for more details.
 """
 
-import cgi
+import html
 import logging
 
 from tg import config, expose, request
@@ -64,8 +64,7 @@
             'protocol': e.get('wsgi.url_scheme'),
             'host': e.get('HTTP_HOST'), }
         if resp:
-            c.error_message = cgi.escape(request.GET.get('code',
-                                                         str(resp.status)))
+            c.error_message = html.escape(request.GET.get('code', str(resp.status)))
             c.error_explanation = self.get_error_explanation(resp.status_int)
         else:
             c.error_message = _('No response')