diff -urN tw2.core-2.2.6.orig/tw2/core/mako_util.py tw2.core-2.2.6/tw2/core/mako_util.py
--- tw2.core-2.2.6.orig/tw2/core/mako_util.py 2019-03-10 21:46:18.000000000 +0100
+++ tw2.core-2.2.6/tw2/core/mako_util.py 2019-08-28 08:46:22.122620780 +0200
@@ -3,7 +3,11 @@
from copy import copy
from markupsafe import Markup
-from cgi import escape
+try:
+ from cgi import escape
+except ImportError:
+ # python >=3.8
+ from html import escape
import six
#from mako.filters import xml_escape