diff options
author | Eli Schwartz <eschwartz93@gmail.com> | 2024-05-16 19:36:32 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2024-05-19 15:49:45 -0400 |
commit | 125d3344ec3361b2fb6d35c6c75c3f6d4f500556 (patch) | |
tree | 0366eedaaf60853d6d6d48db8c940c3de8dba21d /mesonbuild/modules | |
parent | e343590e7d59b4bfd6bc4913ac20ac9c46e702a4 (diff) | |
download | meson-125d3344ec3361b2fb6d35c6c75c3f6d4f500556.zip meson-125d3344ec3361b2fb6d35c6c75c3f6d4f500556.tar.gz meson-125d3344ec3361b2fb6d35c6c75c3f6d4f500556.tar.bz2 |
pylint: fix false positive for variable defined in different copies of conditional
We do:
```
if is_thing:
assignme = value
if_is_thing:
...
else:
assignme = []
```
It is always defined on both sides, but there was no particular reason
we had to assign it in the later copy. pylint reported it as a false
positive, and it may prove confusing in general, and it's harmless to
move, so do so.
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r-- | mesonbuild/modules/gnome.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 410bf74..4405c40 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -440,6 +440,8 @@ class GnomeModule(ExtensionModule): depend_files, depends, subdirs = self._get_gresource_dependencies( state, ifile, source_dirs, dependencies) + else: + depend_files = [] # Make source dirs relative to build dir now source_dirs = [os.path.join(state.build_to_src, state.subdir, d) for d in source_dirs] @@ -492,7 +494,6 @@ class GnomeModule(ExtensionModule): target_cmd = cmd else: depfile = f'{output}.d' - depend_files = [] target_cmd = copy.copy(cmd) + ['--dependency-file', '@DEPFILE@'] target_c = GResourceTarget( name, |