summaryrefslogtreecommitdiff
path: root/paste/exceptions
diff options
context:
space:
mode:
authorChris Dent <cdent@anticdent.org>2018-10-23 17:01:47 +0100
committerChris Dent <cdent@anticdent.org>2018-10-23 17:01:47 +0100
commit9fcc98bd3e5bde3a26326f3156845093f84b8832 (patch)
treef0e7f4980c56e3f296daa1649ae7232bd0e32dd7 /paste/exceptions
parent9a873a24759f69d6414042abdfc2fde21f8cca21 (diff)
downloadpaste-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/exceptions')
-rw-r--r--paste/exceptions/formatter.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/paste/exceptions/formatter.py b/paste/exceptions/formatter.py
index 09309de..3be07ef 100644
--- a/paste/exceptions/formatter.py
+++ b/paste/exceptions/formatter.py
@@ -7,13 +7,13 @@ Formatters for the exception data that comes from ExceptionCollector.
# @@: TODO:
# Use this: http://www.zope.org/Members/tino/VisualTraceback/VisualTracebackNews
-import cgi
+import html
import six
import re
from paste.util import PySourceColor
def html_quote(s):
- return cgi.escape(str(s), True)
+ return html.escape(str(s), True)
class AbstractFormatter(object):
@@ -463,7 +463,7 @@ def format_html(exc_data, include_hidden_frames=False, **ops):
<div id="text_version" class="hidden-data">
<textarea style="width: 100%%" rows=10 cols=60>%s</textarea>
</div>
- """ % (short_er, long_er, cgi.escape(text_er))
+ """ % (short_er, long_er, html.escape(text_er))
def format_text(exc_data, **ops):
return TextFormatter(**ops).format_collected_data(exc_data)