]> granicus.if.org Git - llvm/commitdiff
[lit] Fix running lit tests in unconfigured source dir
authorMichal Gorny <mgorny@gentoo.org>
Sun, 1 Oct 2017 07:13:25 +0000 (07:13 +0000)
committerMichal Gorny <mgorny@gentoo.org>
Sun, 1 Oct 2017 07:13:25 +0000 (07:13 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314620 91177308-0d34-0410-b5e6-96231b3b80d8

utils/lit/tests/lit.cfg

index f2ecaa6d4179e5337b035d414a84383e273d2467..dffaec6584b3706458000030aec1e98bf749e837 100644 (file)
@@ -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