Skip to content

Commit

Permalink
[lit] Fix running lit tests in unconfigured source dir
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mgorny committed Oct 1, 2017
1 parent d26dae0 commit d6a4c79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/utils/lit/tests/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d6a4c79

Please sign in to comment.