From 2013340c1cd429ec126d21fffaa6beaa6621e14e Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Wed, 20 Nov 2024 11:49:17 +0000 Subject: [PATCH] Small code tidy-up --- tools/extract_build_defines.py | 2 +- tools/extract_cmake_configs.py | 2 +- tools/extract_configs.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/extract_build_defines.py b/tools/extract_build_defines.py index cccf64bfe..1db572069 100755 --- a/tools/extract_build_defines.py +++ b/tools/extract_build_defines.py @@ -99,7 +99,7 @@ def ValidateAttrs(config_name, config_attrs, file_path, linenum): _default = config_attrs.get('default', None) if _default is not None: if '/' not in _default: - if (_default.lower() != '0') and (config_attrs['default'].lower() != '1') and ( _default not in all_config_names): + if (_default not in ('0', '1')) and ( _default not in all_config_names): logger.info('{} at {}:{} has non-integer default value "{}"'.format(config_name, file_path, linenum, config_attrs['default'])) elif _type == 'string': diff --git a/tools/extract_cmake_configs.py b/tools/extract_cmake_configs.py index bca62f0f0..8fdb4504e 100755 --- a/tools/extract_cmake_configs.py +++ b/tools/extract_cmake_configs.py @@ -99,7 +99,7 @@ def ValidateAttrs(config_name, config_attrs, file_path, linenum): _default = config_attrs.get('default', None) if _default is not None: if '/' not in _default: - if (_default.lower() != '0') and (config_attrs['default'].lower() != '1') and (_default not in all_config_names): + if (_default not in ('0', '1')) and (_default not in all_config_names): logger.info('{} at {}:{} has non-integer default value "{}"'.format(config_name, file_path, linenum, config_attrs['default'])) elif _type == 'string': diff --git a/tools/extract_configs.py b/tools/extract_configs.py index 52d1c1822..31631681c 100755 --- a/tools/extract_configs.py +++ b/tools/extract_configs.py @@ -105,7 +105,7 @@ def ValidateAttrs(config_name, config_attrs, file_path, linenum): _default = config_attrs.get('default', None) if _default is not None: if '/' not in _default: - if (_default.lower() != '0') and (config_attrs['default'].lower() != '1') and ( _default not in all_config_names): + if (_default not in ('0', '1')) and ( _default not in all_config_names): logger.info('{} at {}:{} has non-integer default value "{}"'.format(config_name, file_path, linenum, config_attrs['default'])) elif _type == 'enum':