summaryrefslogtreecommitdiffstats
path: root/llvm/utils/lit
diff options
context:
space:
mode:
authorMichal Gorny <mgorny@gentoo.org>2017-10-01 07:13:25 +0000
committerMichal Gorny <mgorny@gentoo.org>2017-10-01 07:13:25 +0000
commitd6a4c79b149539eec9a5ed9040307889a83b7875 (patch)
treec379d588e62c266b19d33f3e352892824a9de1c8 /llvm/utils/lit
parentd26dae0d34cf13daab871fcffa513c6dd96a15bb (diff)
downloadbcm5719-llvm-d6a4c79b149539eec9a5ed9040307889a83b7875.tar.gz
bcm5719-llvm-d6a4c79b149539eec9a5ed9040307889a83b7875.zip
[lit] Fix running lit tests in unconfigured source dir
Fix llvm_tools_dir attribute access not to fail when the variable is not present. This directory is not really necessary to run lit tests, and the code already accounts for it being None. The reference was added in r313407, and it breaks the stand-alone lit package in Gentoo. Differential Revision: https://reviews.llvm.org/D38442 llvm-svn: 314620
Diffstat (limited to 'llvm/utils/lit')
-rw-r--r--llvm/utils/lit/tests/lit.cfg2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/utils/lit/tests/lit.cfg b/llvm/utils/lit/tests/lit.cfg
index f2ecaa6d417..dffaec6584b 100644
--- a/llvm/utils/lit/tests/lit.cfg
+++ b/llvm/utils/lit/tests/lit.cfg
@@ -65,6 +65,6 @@ if sys.platform.startswith('win') or sys.platform.startswith('cygwin'):
config.available_features.add('windows')
# Add llvm tools directory if this config is being loaded indirectly
-if config.llvm_tools_dir is not None:
+if getattr(config, 'llvm_tools_dir', None) is not None:
path = os.path.pathsep.join((config.llvm_tools_dir, config.environment['PATH']))
config.environment['PATH'] = path
OpenPOWER on IntegriCloud