Cherry-pick no-cgi patch to fix tests with new python3.8

This commit is contained in:
Gianfranco Costamagna 2020-02-25 15:00:12 +01:00
parent 8dbb2f7037
commit b4e77bcc32
3 changed files with 48 additions and 0 deletions

3
debian/changelog vendored
View File

@ -12,6 +12,9 @@ llvm-toolchain-snapshot (1:11~++20200124010400+805c157e8ae-1~exp1) UNRELEASED; u
* clang-tools-X.Y.install.in: Do not try to install hwasan_symbolize on * clang-tools-X.Y.install.in: Do not try to install hwasan_symbolize on
hurd-any. hurd-any.
[ Gianfranco Costamagna ]
* Add patch to port from old cgi to new html python3 method
-- Sylvestre Ledru <sylvestre@debian.org> Fri, 24 Jan 2020 13:06:56 +0100 -- Sylvestre Ledru <sylvestre@debian.org> Fri, 24 Jan 2020 13:06:56 +0100
llvm-toolchain-snapshot (1:11~++20200123111717+04fd2041561-1~exp1) experimental; urgency=medium llvm-toolchain-snapshot (1:11~++20200123111717+04fd2041561-1~exp1) experimental; urgency=medium

44
debian/patches/no-cgi.patch vendored Normal file
View File

@ -0,0 +1,44 @@
Description: cgi method is deprecated, use html instead
Author: Gianfranco Costamagna <locutusofborg@debian.org>
Last-Update: 2020-02-25
--- llvm-toolchain-10-10.0.0~+rc2.orig/llvm/tools/opt-viewer/opt-viewer.py
+++ llvm-toolchain-10-10.0.0~+rc2/llvm/tools/opt-viewer/opt-viewer.py
@@ -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>
--- llvm-toolchain-10-10.0.0~+rc2.orig/llvm/tools/opt-viewer/optrecord.py
+++ llvm-toolchain-10-10.0.0~+rc2/llvm/tools/opt-viewer/optrecord.py
@@ -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))

View File

@ -140,3 +140,4 @@ no-z3.patch
python3-shebang.patch python3-shebang.patch
print-lldb-path.patch print-lldb-path.patch
no-cgi.patch