diff options
| author | Eli Schwartz <eschwartz93@gmail.com> | 2024-05-16 19:24:07 -0400 |
|---|---|---|
| committer | Eli Schwartz <eschwartz93@gmail.com> | 2024-05-19 14:40:28 -0400 |
| commit | 29a62ff794df3d72616740be9723b87f6b491722 (patch) | |
| tree | d0e54351bf1e40eb85cf08bf2c5374798cd9dc3b | |
| parent | 128f0e828e425793203f3112c23cb31f959b4b3e (diff) | |
| download | meson-29a62ff794df3d72616740be9723b87f6b491722.tar.gz | |
pylint: fix false positive for missing else branch
We cover every case as if/elif/elif. mypy can handle this fine, but
pylint doesn't do control flow or type checking and thinks in the
missing else case, the variable might not be defined.
For mypy as well, doing this instance check is unnecessary as it can be
inferred. So just micro-optimize the check and allow pylint to safely
analyze the logic.
| -rw-r--r-- | mesonbuild/linkers/detect.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/linkers/detect.py b/mesonbuild/linkers/detect.py index 65d77f642..1db3948c1 100644 --- a/mesonbuild/linkers/detect.py +++ b/mesonbuild/linkers/detect.py @@ -45,7 +45,7 @@ def guess_win_linker(env: 'Environment', compiler: T.List[str], comp_class: T.Ty check_args = ['/logo', '--version'] elif isinstance(comp_class.LINKER_PREFIX, str): check_args = [comp_class.LINKER_PREFIX + '/logo', comp_class.LINKER_PREFIX + '--version'] - elif isinstance(comp_class.LINKER_PREFIX, list): + else: # list check_args = comp_class.LINKER_PREFIX + ['/logo'] + comp_class.LINKER_PREFIX + ['--version'] check_args += env.coredata.get_external_link_args(for_machine, comp_class.language) |
