[clang-tools-extra] aa189ed - Fix compatibility with python3 of clang-include-fixer.py

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 3 03:55:43 PST 2019


Author: Yannick Brehon
Date: 2019-12-03T12:55:13+01:00
New Revision: aa189ed25fbd861b07eb5d5116dfd8e33e2b1991

URL: https://github.com/llvm/llvm-project/commit/aa189ed25fbd861b07eb5d5116dfd8e33e2b1991
DIFF: https://github.com/llvm/llvm-project/commit/aa189ed25fbd861b07eb5d5116dfd8e33e2b1991.diff

LOG: Fix compatibility with python3 of clang-include-fixer.py

clang-include-fixer was recently updated to be python3-compatible.
However, an exception handling clause was improperly using the deprecated `message` property of Exception classes, so the code was not yet entirely python3-compatible.

Differential Revision: https://reviews.llvm.org/D70902

Added: 
    

Modified: 
    clang-tools-extra/clang-include-fixer/tool/clang-include-fixer.py

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clang-include-fixer/tool/clang-include-fixer.py b/clang-tools-extra/clang-include-fixer/tool/clang-include-fixer.py
index fcdd5a0b60ee..e3a52f094f66 100644
--- a/clang-tools-extra/clang-include-fixer/tool/clang-include-fixer.py
+++ b/clang-tools-extra/clang-include-fixer/tool/clang-include-fixer.py
@@ -211,7 +211,7 @@ def main():
     InsertHeaderToVimBuffer(include_fixer_context, text)
     print("Added #include {0} for {1}.".format(selected, symbol))
   except Exception as error:
-    print(error.message, file=sys.stderr)
+    print(error, file=sys.stderr)
   return
 
 


        


More information about the cfe-commits mailing list