[llvm] r350320 - Python compat - decode/encode string
Serge Guelton via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 3 06:40:34 PST 2019
Author: serge_sans_paille
Date: Thu Jan 3 06:40:34 2019
New Revision: 350320
URL: http://llvm.org/viewvc/llvm-project?rev=350320&view=rev
Log:
Python compat - decode/encode string
Differential Revision: https://reviews.llvm.org/D56258
Modified:
llvm/trunk/tools/opt-viewer/opt-viewer.py
Modified: llvm/trunk/tools/opt-viewer/opt-viewer.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt-viewer/opt-viewer.py?rev=350320&r1=350319&r2=350320&view=diff
==============================================================================
--- llvm/trunk/tools/opt-viewer/opt-viewer.py (original)
+++ llvm/trunk/tools/opt-viewer/opt-viewer.py Thu Jan 3 06:40:34 2019
@@ -72,7 +72,10 @@ class SourceFileRenderer:
file_text = stream.read()
if self.no_highlight:
- html_highlighted = file_text.decode('utf-8')
+ if sys.version_info.major >= 3:
+ html_highlighted = file_text
+ else:
+ html_highlighted = file_text.decode('utf-8')
else:
html_highlighted = highlight(
file_text,
More information about the llvm-commits
mailing list