tambre created this revision. tambre added a reviewer: rsmith. Herald added a project: clang. Herald added a subscriber: cfe-commits.
The 'is' operator is not meant to be used for comparisons. It currently working is an implementation detail of CPython. CPython 3.8 has added a SyntaxWarning for this. Repository: rC Clang https://reviews.llvm.org/D61549 Files: clang/tools/clang-format/clang-format.py Index: clang/tools/clang-format/clang-format.py =================================================================== --- clang/tools/clang-format/clang-format.py +++ clang/tools/clang-format/clang-format.py @@ -118,7 +118,7 @@ lines = lines[1:] sequence = difflib.SequenceMatcher(None, buf, lines) for op in reversed(sequence.get_opcodes()): - if op[0] is not 'equal': + if op[0] != 'equal': vim.current.buffer[op[1]:op[2]] = lines[op[3]:op[4]] if output.get('IncompleteFormat'): print('clang-format: incomplete (syntax errors)')
Index: clang/tools/clang-format/clang-format.py =================================================================== --- clang/tools/clang-format/clang-format.py +++ clang/tools/clang-format/clang-format.py @@ -118,7 +118,7 @@ lines = lines[1:] sequence = difflib.SequenceMatcher(None, buf, lines) for op in reversed(sequence.get_opcodes()): - if op[0] is not 'equal': + if op[0] != 'equal': vim.current.buffer[op[1]:op[2]] = lines[op[3]:op[4]] if output.get('IncompleteFormat'): print('clang-format: incomplete (syntax errors)')
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits