diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2018-02-17 19:53:54 +0000 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-02-21 19:10:56 +0200 |
commit | 845dbfcbbc40b0060b1ed7d7df0431c5f4a11497 (patch) | |
tree | e8c029be7a6ad474807406b89cff0afdbb3bc8b6 | |
parent | 1e82416a938a962ed626f9f628dd0f89d49d05a8 (diff) | |
download | meson-845dbfcbbc40b0060b1ed7d7df0431c5f4a11497.zip meson-845dbfcbbc40b0060b1ed7d7df0431c5f4a11497.tar.gz meson-845dbfcbbc40b0060b1ed7d7df0431c5f4a11497.tar.bz2 |
Handle a warning location which evaluates to False
As written in PR #2856, this code isn't quite right.
An ArgumentNode object can evaluate as False (if it's arguments attribute is
an empty sequence).
If that happens, we then try to hand the location kwarg down to print(),
rather than removing it, which causes an invalid keyword argument exception.
This failure can be seen e.g. when generating for gnome-twitch (See [1])
[1] https://travis-ci.org/jon-turney/meson-corpus-test/jobs/343017109
-rw-r--r-- | mesonbuild/mlog.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/mlog.py b/mesonbuild/mlog.py index 273552d..3c34b85 100644 --- a/mesonbuild/mlog.py +++ b/mesonbuild/mlog.py @@ -107,7 +107,7 @@ def warning(*args, **kwargs): args = (yellow('WARNING:'),) + args - if kwargs.get('location'): + if 'location' in kwargs: location = kwargs['location'] del kwargs['location'] location = '{}:{}:'.format(os.path.join(location.subdir, environment.build_filename), location.lineno) |