[compiler-rt] acb3b8d - [Sanitizers] Fix lint failure with Python 3.6
Nemanja Ivanovic via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 31 04:22:16 PDT 2020
Author: Nemanja Ivanovic
Date: 2020-07-31T06:20:49-05:00
New Revision: acb3b8dce1cd7ed25a137c718678449dd2d77f79
URL: https://github.com/llvm/llvm-project/commit/acb3b8dce1cd7ed25a137c718678449dd2d77f79
DIFF: https://github.com/llvm/llvm-project/commit/acb3b8dce1cd7ed25a137c718678449dd2d77f79.diff
LOG: [Sanitizers] Fix lint failure with Python 3.6
There are some files in compiler-rt that use UTF-8 characters in some of the
comments. This causes lint failures with some versions of Python. This patch
just makes the encoding explicit in the call to open.
Added:
Modified:
compiler-rt/lib/sanitizer_common/scripts/litlint.py
Removed:
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/scripts/litlint.py b/compiler-rt/lib/sanitizer_common/scripts/litlint.py
index 81b89c214438..c443efb915a9 100755
--- a/compiler-rt/lib/sanitizer_common/scripts/litlint.py
+++ b/compiler-rt/lib/sanitizer_common/scripts/litlint.py
@@ -45,7 +45,7 @@ def LintFile(p):
The number of errors detected.
"""
errs = 0
- with open(p, 'r') as f:
+ with open(p, 'r', encoding='utf-8') as f:
for i, s in enumerate(f.readlines(), start=1):
msg, col = LintLine(s)
if msg != None:
More information about the llvm-commits
mailing list