-# Copyright (C) 2013, 2014, 2015, 2018, 2020, 2021 The Meme Factory, Inc.
+# Copyright (C) 2013, 2014, 2015, 2018, 2020, 2021, 2024 The Meme Factory, Inc.
# http://www.karlpinc.com/
# This file is part of PGWUI_Core.
'''Exceptions
'''
-from cgi import escape as cgi_escape
+from html import escape as html_escape
class PGWUIError(Exception):
Produce an html formatted message from a psycopg2 DatabaseError
exception.
'''
- primary = cgi_escape(ex.diag.message_primary)
+ primary = html_escape(ex.diag.message_primary)
if ex.diag.message_detail is None:
detail = ''
else:
- detail = '<br />DETAIL: ' + cgi_escape(ex.diag.message_detail)
+ detail = '<br />DETAIL: ' + html_escape(ex.diag.message_detail)
if ex.diag.message_hint is None:
hint = ''
else:
- hint = '<br />HINT: ' + cgi_escape(ex.diag.message_hint)
+ hint = '<br />HINT: ' + html_escape(ex.diag.message_hint)
return '<blockquote><p>{0}: {1}{2}{3}</p></blockquote>'.format(
ex.diag.severity,