[clang-tidy] Handle missing yaml module in run-clang-tidy.py
authorZinovy Nis <zinovy.nis@gmail.com>
Wed, 27 Mar 2019 19:21:32 +0000 (19:21 +0000)
committerZinovy Nis <zinovy.nis@gmail.com>
Wed, 27 Mar 2019 19:21:32 +0000 (19:21 +0000)
commitf8b7269f983aad40730ad845dae5c3d2f43093b0
treec52608e5813983a0d2c4640767205395f770ab2a
parent1a0a24f1104af4a4b4df80ab729ff3640a44eb70
[clang-tidy] Handle missing yaml module in run-clang-tidy.py

The Yaml module is missing on some systems and on many of clang buildbots.
But the test for run-clang-tidy.py doesn't fail due to 'NOT' statement masking a python runtime error.

This patch conditionally imports and enables the yaml module only if it's present in the system.
If not, then '-export-fixes' is disabled.

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

llvm-svn: 357114
clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
clang-tools-extra/test/clang-tidy/bugprone-parent-virtual-call.cpp [changed mode: 0755->0644]
clang-tools-extra/test/clang-tidy/run-clang-tidy.cpp