diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2025-10-21 10:41:16 +0200 |
|---|---|---|
| committer | Jussi Pakkanen <jussi.pakkanen@mailbox.org> | 2025-10-29 18:59:30 +0200 |
| commit | a5b0fa917cf0af093ba4ebffc3d8f7d1030d1b14 (patch) | |
| tree | de89b006df28c71d98b48fac747e84fa148dab8b | |
| parent | 2816f1131ec5ad97a3505f391084bec2174430cf (diff) | |
| download | meson-a5b0fa917cf0af093ba4ebffc3d8f7d1030d1b14.tar.gz | |
replace "in d.keys()" with "in d"
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| -rw-r--r-- | mesonbuild/interpreterbase/decorators.py | 2 | ||||
| -rw-r--r-- | mesonbuild/msetup.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/interpreterbase/decorators.py b/mesonbuild/interpreterbase/decorators.py index ea1d30605..486a58573 100644 --- a/mesonbuild/interpreterbase/decorators.py +++ b/mesonbuild/interpreterbase/decorators.py @@ -498,7 +498,7 @@ def typed_kwargs(name: str, *types: KwargInfo, allow_unknown: bool = False) -> T if n in value: warning = f'value "{n}" in list' elif isinstance(value, dict): - if n in value.keys(): + if n in value: warning = f'value "{n}" in dict keys' elif n == value: warning = f'value "{n}"' diff --git a/mesonbuild/msetup.py b/mesonbuild/msetup.py index 33c489958..df06245a3 100644 --- a/mesonbuild/msetup.py +++ b/mesonbuild/msetup.py @@ -364,7 +364,7 @@ def run_genvslite_setup(options: CMDOptions) -> None: # The command line may specify a '--backend' option, which doesn't make sense in conjunction with # '--genvslite', where we always want to use a ninja back end - k_backend = OptionKey('backend') - if k_backend in options.cmd_line_options.keys(): + if k_backend in options.cmd_line_options: if options.cmd_line_options[k_backend] != 'ninja': raise MesonException('Explicitly specifying a backend option with \'genvslite\' is not necessary ' '(the ninja backend is always used) but specifying a non-ninja backend ' @@ -397,7 +397,7 @@ def run(options: T.Union[CMDOptions, T.List[str]]) -> int: # lie options.pager = False - if OptionKey('genvslite') in options.cmd_line_options.keys(): + if OptionKey('genvslite') in options.cmd_line_options: run_genvslite_setup(options) else: app = MesonApp(options) |
