Use underscore for variables that we don't reference

This pleases pyright/pylance and is a pattern that we use in other
portions of the code.
pull/11976/head
Tristan Partin 1 year ago
parent 24edddb412
commit 020692b9d9
  1. 6
      mesonbuild/utils/universal.py

@ -1214,7 +1214,7 @@ def do_define(regex: T.Pattern[str], line: str, confdata: 'ConfigurationData',
define_value: T.List[str] = []
for token in arr[2:]:
try:
(v, desc) = confdata.get(token)
v, _ = confdata.get(token)
define_value += [str(v)]
except KeyError:
define_value += [token]
@ -1230,7 +1230,7 @@ def do_define(regex: T.Pattern[str], line: str, confdata: 'ConfigurationData',
varname = arr[1]
try:
(v, desc) = confdata.get(varname)
v, _ = confdata.get(varname)
except KeyError:
return '/* #undef %s */\n' % varname
if isinstance(v, bool):
@ -1246,7 +1246,7 @@ def do_define(regex: T.Pattern[str], line: str, confdata: 'ConfigurationData',
else:
result = get_cmake_define(line, confdata)
result = f'#define {varname} {result}\n'
(result, missing_variable) = do_replacement(regex, result, variable_format, confdata)
result, _ = do_replacement(regex, result, variable_format, confdata)
return result
else:
raise MesonException('#mesondefine argument "%s" is of unknown type.' % varname)

Loading…
Cancel
Save