From a5b0fa917cf0af093ba4ebffc3d8f7d1030d1b14 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 21 Oct 2025 10:41:16 +0200 Subject: replace "in d.keys()" with "in d" Signed-off-by: Paolo Bonzini --- mesonbuild/interpreterbase/decorators.py | 2 +- 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) -- cgit v1.3