Skip to content

Commit

Permalink
Small code tidy-up
Browse files Browse the repository at this point in the history
  • Loading branch information
lurch committed Nov 20, 2024
1 parent e77ab70 commit 2013340
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tools/extract_build_defines.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
2 changes: 1 addition & 1 deletion tools/extract_cmake_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
2 changes: 1 addition & 1 deletion tools/extract_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down

0 comments on commit 2013340

Please sign in to comment.