[PATCH] D51220: [clang-tidy] run-clang-tidy fails using python 3.7

Andi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 24 09:05:10 PDT 2018


Abpostelnicu updated this revision to Diff 162391.

https://reviews.llvm.org/D51220

Files:
  clang-tidy/tool/run-clang-tidy.py


Index: clang-tidy/tool/run-clang-tidy.py
===================================================================
--- clang-tidy/tool/run-clang-tidy.py
+++ clang-tidy/tool/run-clang-tidy.py
@@ -166,18 +166,10 @@
     output, err = proc.communicate()
     if proc.returncode != 0:
       failed_files.append(name)
-
-    if is_py2:
-      output_string = output
-      err_string = err
-    else:
-      output_string = str(output, 'utf-8')
-      err_string = str(err, 'utf-8')
-
     with lock:
-      sys.stdout.write(' '.join(invocation) + '\n' + output_string + '\n')
+      sys.stdout.write(' '.join(invocation) + '\n' + output.decode('utf-8') + '\n')
       if err:
-        sys.stderr.write(err_string + '\n')
+        sys.stderr.write(err.decode('utf-8') + '\n')
     queue.task_done()
 
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51220.162391.patch
Type: text/x-patch
Size: 793 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180824/e1b728db/attachment-0001.bin>


More information about the cfe-commits mailing list