Description: Python 3.13 removes cgi

Author: Matthieu Moy, Rebecca N. Palmer <rebecca_palmer@zoho.com>
Origin: based on git-multimail ddc9a1c
Bug-Debian: https://bugs.debian.org/1084587
Forwarded: https://pagure.io/pagure/pull-request/5514

--- a/pagure/hooks/files/git_multimail_upstream.py
+++ b/pagure/hooks/files/git_multimail_upstream.py
@@ -67,7 +67,7 @@ except ImportError:
     # Python < 2.6 do not have ssl, but that's OK if we don't use it.
     pass
 import time
-import cgi
+import html
 
 PYTHON3 = sys.version_info >= (3, 0)
 
@@ -886,7 +886,7 @@ class Change(object):
         if html_escape_val:
             for k in values:
                 if is_string(values[k]):
-                    values[k] = cgi.escape(values[k], True)
+                    values[k] = html.escape(values[k], True)
         for line in template.splitlines(True):
             yield line % values
 
@@ -969,7 +969,7 @@ class Change(object):
             yield "<pre style='margin:0'>\n"
 
             for line in lines:
-                yield cgi.escape(line)
+                yield html.escape(line)
 
             yield "</pre>\n"
         else:
@@ -1047,7 +1047,7 @@ class Change(object):
                     fgcolor = "404040"
 
                 # Chop the trailing LF, we don't want it inside <pre>.
-                line = cgi.escape(line[:-1])
+                line = html.escape(line[:-1])
 
                 if bgcolor or fgcolor:
                     style = "display:block; white-space:pre;"
