Skip to content

Commit

Permalink
pylint: fix false positive for variable defined in different copies o…
Browse files Browse the repository at this point in the history
…f 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.
  • Loading branch information
eli-schwartz committed May 19, 2024
1 parent e343590 commit 125d334
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mesonbuild/modules/gnome.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,8 @@ def compile_resources(self, state: 'ModuleState', args: T.Tuple[str, 'FileOrStri

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]
Expand Down Expand Up @@ -492,7 +494,6 @@ def compile_resources(self, state: 'ModuleState', args: T.Tuple[str, 'FileOrStri
target_cmd = cmd
else:
depfile = f'{output}.d'
depend_files = []
target_cmd = copy.copy(cmd) + ['--dependency-file', '@DEPFILE@']
target_c = GResourceTarget(
name,
Expand Down

0 comments on commit 125d334

Please sign in to comment.