diff options
author | Chris Dent <cdent@anticdent.org> | 2018-10-23 17:01:47 +0100 |
---|---|---|
committer | Chris Dent <cdent@anticdent.org> | 2018-10-23 17:01:47 +0100 |
commit | 9fcc98bd3e5bde3a26326f3156845093f84b8832 (patch) | |
tree | f0e7f4980c56e3f296daa1649ae7232bd0e32dd7 /paste/evalexception/middleware.py | |
parent | 9a873a24759f69d6414042abdfc2fde21f8cca21 (diff) | |
download | paste-git-9fcc98bd3e5bde3a26326f3156845093f84b8832.tar.gz |
Fix up testing after switch to pytest
pytest exposes many warnings, some but not all of which are cleaned
up here. The main switch is to use html.escape instead of cgi.escape.
This inspired the addition of 'future' to requirements.
The remaining warnings are related to pytest deprecations or over-eager
test discovery.
It is perhaps ironic that the switch to pytest is to avoid nose being
mostly dead, and now we are using features in pytest that pytest wants
to make dead. These are left for later cleanups, which means that
running the tests is noisy.
Diffstat (limited to 'paste/evalexception/middleware.py')
-rw-r--r-- | paste/evalexception/middleware.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/paste/evalexception/middleware.py b/paste/evalexception/middleware.py index da7876d..f41a4f5 100644 --- a/paste/evalexception/middleware.py +++ b/paste/evalexception/middleware.py @@ -29,7 +29,7 @@ from __future__ import print_function import sys import os -import cgi +import html import traceback import six from six.moves import cStringIO as StringIO @@ -54,7 +54,7 @@ def html_quote(v): """ if v is None: return '' - return cgi.escape(str(v), 1) + return html.escape(str(v), 1) def preserve_whitespace(v, quote=True): """ @@ -527,7 +527,7 @@ def format_eval_html(exc_data, base_path, counter): <div id="text_version" class="hidden-data"> <textarea style="width: 100%%" rows=10 cols=60>%s</textarea> </div> - """ % (short_er, full_traceback_html, cgi.escape(text_er)) + """ % (short_er, full_traceback_html, html.escape(text_er)) def make_repost_button(environ): url = request.construct_url(environ) |