diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-02-19 05:42:14 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-02-19 23:13:32 +0530 |
commit | d1bc5c340497140742feef05f1691ae77ccb82ea (patch) | |
tree | eb6c6ad41630553a28fc30754648efa03538573a | |
parent | f1fe823763bf0b9b7320639e918ab32b56065145 (diff) | |
download | meson-d1bc5c340497140742feef05f1691ae77ccb82ea.zip meson-d1bc5c340497140742feef05f1691ae77ccb82ea.tar.gz meson-d1bc5c340497140742feef05f1691ae77ccb82ea.tar.bz2 |
add_test_setup: Treat no env as empty env
Otherwise env is {} and we get a traceback trying to use the setup:
$ /home/cassidy/dev/meson/mesontest.py -C build --setup valgrind
ninja: Entering directory `/home/cassidy/dev/gst/master/gst-build/build'
ninja: no work to do.
Traceback (most recent call last):
File "/home/cassidy/dev/meson/mesontest.py", line 579, in <module>
sys.exit(run(sys.argv[1:]))
File "/home/cassidy/dev/meson/mesontest.py", line 575, in run
return th.doit()
File "/home/cassidy/dev/meson/mesontest.py", line 337, in doit
self.run_tests(tests)
File "/home/cassidy/dev/meson/mesontest.py", line 485, in run_tests
self.drain_futures(futures, logfile, jsonlogfile)
File "/home/cassidy/dev/meson/mesontest.py", line 504, in drain_futures
self.print_stats(numlen, tests, name, result.result(), i, logfile, jsonlogfile)
File "/usr/lib64/python3.5/concurrent/futures/_base.py", line 398, in result
return self.__get_result()
File "/usr/lib64/python3.5/concurrent/futures/_base.py", line 357, in __get_result
raise self._exception
File "/usr/lib64/python3.5/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/cassidy/dev/meson/mesontest.py", line 216, in run_single_test
child_env.update(self.options.global_env.get_env(child_env))
AttributeError: 'dict' object has no attribute 'get_env'
There is no harm in doing this, and this is the simplest fix for this.
Closes https://github.com/mesonbuild/meson/issues/1371
-rw-r--r-- | mesonbuild/interpreter.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 020f84c..ba1ebf3 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -2060,7 +2060,7 @@ requirements use the version keyword argument instead.''') self.add_test(node, args, kwargs, True) def unpack_env_kwarg(self, kwargs): - envlist = kwargs.get('env', []) + envlist = kwargs.get('env', EnvironmentVariablesHolder()) if isinstance(envlist, EnvironmentVariablesHolder): env = envlist.held_object else: |