summaryrefslogtreecommitdiff
path: root/src/zope/tales/tales.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/zope/tales/tales.py')
-rw-r--r--src/zope/tales/tales.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/zope/tales/tales.py b/src/zope/tales/tales.py
index 9765fc8..0cb5ce2 100644
--- a/src/zope/tales/tales.py
+++ b/src/zope/tales/tales.py
@@ -18,6 +18,11 @@ An implementation of a TAL expression engine
__docformat__ = "reStructuredText"
import re
+try:
+ from html import escape
+except ImportError:
+ from cgi import escape
+
from zope.interface import implementer
from zope.interface import Interface
import six
@@ -822,5 +827,4 @@ class TALESTracebackSupplement(object):
if not as_html:
return ' - Names:\n %s' % s.replace('\n', '\n ')
- from cgi import escape
return '<b>Names:</b><pre>%s</pre>' % (escape(s))