[PATCH] D56258: python compat - encode/decode

serge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 3 03:25:05 PST 2019


serge-sans-paille created this revision.
serge-sans-paille added a reviewer: michaelplatings.
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

https://reviews.llvm.org/D56258

Files:
  tools/opt-viewer/opt-viewer.py


Index: tools/opt-viewer/opt-viewer.py
===================================================================
--- tools/opt-viewer/opt-viewer.py
+++ tools/opt-viewer/opt-viewer.py
@@ -72,7 +72,10 @@
         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,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56258.180021.patch
Type: text/x-patch
Size: 575 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190103/c57047b3/attachment.bin>


More information about the llvm-commits mailing list