summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
authorMatt Beardsley <mbeardsl@mathworks.com>2021-09-11 09:52:47 +0200
committerKirill Bobyrev <kbobyrev@google.com>2021-09-11 09:52:50 +0200
commitc6bf8b8592431a4e39aeb20cc185b8fae0d52e43 (patch)
treec219065d6e6b4251bb8f9ef8ff08be43be0e6869 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
parent4e408aae2c55a8fd71b5a96eb86db350a7acc443 (diff)
Fix python 2-vs-3 issues in add_new_check.py and rename_check.py
As of this commit: https://github.com/llvm/llvm-project/commit/307b1fdd If either of those scripts are invoked with python 2, neither works due to: "TypeError: write() argument 1 must be unicode, not str" And if rename_check.py is invoked with python 3: "ValueError: binary mode doesn't take an encoding argument" (referring to `with io.open(filename, 'wb', encoding='utf8') as f:`), and Another issue in rename_check.py in python 2: "TypeError: list object is not an iterator" (referring to `next(filter( ... os.listdir(old_module_path)))`) (so, rename_check doesn't work with either 2 or 3, and add_new_check doesn't work with 2, but does work with 3) I ran these steps to test both python versions: (manually - appears to be the "status quo" for these files) python3 clang-tools-extra/clang-tidy/add_new_check.py readability ggggg python3 clang-tools-extra/clang-tidy/rename_check.py readability-ggggg readability-hhhhh git checkout HEAD -- clang-tools-extra/clang-tidy/readability/CMakeLists.txt clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp clang-tools-extra/docs/ReleaseNotes.rst clang-tools-extra/docs/clang-tidy/checks/list.rst rm -f clang-tools-extra/clang-tidy/readability/GggggCheck.cpp clang-tools-extra/clang-tidy/readability/GggggCheck.h clang-tools-extra/docs/clang-tidy/checks/readability-ggggg.rst clang-tools-extra/test/clang-tidy/checkers/readability-ggggg.cpp clang-tools-extra/clang-tidy/readability/HhhhhCheck.cpp clang-tools-extra/clang-tidy/readability/HhhhhCheck.h clang-tools-extra/docs/clang-tidy/checks/readability-hhhhh.rst python2 clang-tools-extra/clang-tidy/add_new_check.py readability ggggg python2 clang-tools-extra/clang-tidy/rename_check.py readability-ggggg readability-hhhhh git checkout HEAD -- clang-tools-extra/clang-tidy/readability/CMakeLists.txt clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp clang-tools-extra/docs/ReleaseNotes.rst clang-tools-extra/docs/clang-tidy/checks/list.rst rm -f clang-tools-extra/clang-tidy/readability/GggggCheck.cpp clang-tools-extra/clang-tidy/readability/GggggCheck.h clang-tools-extra/docs/clang-tidy/checks/readability-ggggg.rst clang-tools-extra/test/clang-tidy/checkers/readability-ggggg.cpp clang-tools-extra/clang-tidy/readability/HhhhhCheck.cpp clang-tools-extra/clang-tidy/readability/HhhhhCheck.h clang-tools-extra/docs/clang-tidy/checks/readability-hhhhh.rst Reviewed By: kbobyrev Differential Revision: https://reviews.llvm.org/D109127
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
0 files changed, 0 insertions, 0 deletions