Abpostelnicu updated this revision to Diff 162387.

https://reviews.llvm.org/D49851

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,10 +166,18 @@
     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 + '\n')
-      if err > 0:
-        sys.stderr.write(err + '\n')
+      sys.stdout.write(' '.join(invocation) + '\n' + output_string + '\n')
+      if err:
+        sys.stderr.write(err_string + '\n')
     queue.task_done()
 
 


Index: clang-tidy/tool/run-clang-tidy.py
===================================================================
--- clang-tidy/tool/run-clang-tidy.py
+++ clang-tidy/tool/run-clang-tidy.py
@@ -166,10 +166,18 @@
     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 + '\n')
-      if err > 0:
-        sys.stderr.write(err + '\n')
+      sys.stdout.write(' '.join(invocation) + '\n' + output_string + '\n')
+      if err:
+        sys.stderr.write(err_string + '\n')
     queue.task_done()
 
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to