# HG changeset patch # User Mads Kiilerich # Date 1577289679 -3600 # Node ID 02c119ae72e1f2360e966df73e457185bad85429 # Parent 22b40db44a417cce05ccbc26996b15d904a33cb8 py3: use html.escape instead of cgi.escape DeprecationWarning: cgi.escape is deprecated, use html.escape instead diff -r 22b40db44a41 -r 02c119ae72e1 kallithea/controllers/error.py --- 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')