aboutsummaryrefslogtreecommitdiff
path: root/share/opt-viewer/optrecord.py
diff options
context:
space:
mode:
authorDanny <danny@kdrag0n.dev>2021-01-09 23:34:32 +0000
committermosimchah <mosimchah@gmail.com>2021-01-22 03:35:20 -0800
commit783d21ff74759076d2fc503685ca47d2c29baea3 (patch)
treed650cc46cbf7ca53f15c77ced2682e97d492c068 /share/opt-viewer/optrecord.py
parentfdbc6f7102056fb52d26bfb2cbc6ea317890ee34 (diff)
Update to 20210109 buildHEADmaster
LLVM commit: https://github.com/llvm/llvm-project/commit/b02eab9058e58782fca32dd8b1e53c27ed93f866 binutils version: 2.35.1 Builder commit: https://github.com/kdrag0n/proton-clang-build/commit/ba42f701467c9103f23fbb90aca4b23858221ee2
Diffstat (limited to 'share/opt-viewer/optrecord.py')
-rwxr-xr-xshare/opt-viewer/optrecord.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/share/opt-viewer/optrecord.py b/share/opt-viewer/optrecord.py
index f6fd772..6a53e13 100755
--- a/share/opt-viewer/optrecord.py
+++ b/share/opt-viewer/optrecord.py
@@ -2,6 +2,7 @@
from __future__ import print_function
+import io
import yaml
# Try to use the C parser.
try:
@@ -10,7 +11,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 +159,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))
@@ -272,7 +273,7 @@ def get_remarks(input_file, filter_=None):
all_remarks = dict()
file_remarks = defaultdict(functools.partial(defaultdict, list))
- with open(input_file) as f:
+ with io.open(input_file, encoding = 'utf-8') as f:
docs = yaml.load_all(f, Loader=Loader)
filter_e = None