cgi method is deprecated, use html instead
authorGianfranco Costamagna <locutusofborg@debian.org>
Tue, 25 Feb 2020 14:28:58 +0000 (14:28 +0000)
committerGianfranco Costamagna <locutusofborg@debian.org>
Tue, 25 Feb 2020 14:28:58 +0000 (14:28 +0000)
Last-Update: 2020-02-25

Gbp-Pq: Name no-cgi.patch

llvm/tools/opt-viewer/opt-viewer.py
llvm/tools/opt-viewer/optrecord.py

index c4619a6cb9156d5edd822fdaac74c6b6b772a245..58697f90ee87e70404ca9e3e23a8ad081278ec16 100755 (executable)
@@ -3,7 +3,7 @@
 from __future__ import print_function
 
 import argparse
-import cgi
+import html
 import codecs
 import errno
 import functools
@@ -200,7 +200,7 @@ class IndexRenderer:
         self.max_hottest_remarks_on_index = max_hottest_remarks_on_index
 
     def render_entry(self, r, odd):
-        escaped_name = cgi.escape(r.DemangledFunctionName)
+        escaped_name = html.escape(r.DemangledFunctionName)
         print(u'''
 <tr>
 <td class=\"column-entry-{odd}\"><a href={r.Link}>{r.DebugLocString}</a></td>
index 8c8f4c8c90ef0562675a9e0c03dd82943b9f33c6..17d441b5f41d9bfabdfe7ef958da96588cb857e7 100644 (file)
@@ -10,7 +10,7 @@ except ImportError:
     print("For faster parsing, you may want to install libYAML for PyYAML")
     from yaml import Loader
 
-import cgi
+import html
 from collections import defaultdict
 import fnmatch
 import functools
@@ -158,7 +158,7 @@ class Remark(yaml.YAMLObject):
         (key, value) = list(mapping.items())[0]
 
         if key == 'Caller' or key == 'Callee' or key == 'DirectCallee':
-            value = cgi.escape(self.demangle(value))
+            value = html.escape(self.demangle(value))
 
         if dl and key != 'Caller':
             dl_dict = dict(list(dl))