diff --git a/mesonbuild/utils/universal.py b/mesonbuild/utils/universal.py index 904cbbcfe7d7..039b0d91e5f1 100644 --- a/mesonbuild/utils/universal.py +++ b/mesonbuild/utils/universal.py @@ -1346,7 +1346,7 @@ def do_conf_str(src: str, data: T.List[str], confdata: 'ConfigurationData', raise MesonException('Invalid variable format') def do_conf_str_meson(src: str, data: T.List[str], confdata: 'ConfigurationData', subproject: T.Optional[SubProject] = None) -> T.Tuple[T.List[str], T.Set[str], bool]: - variable_format = "meson" + variable_format: Literal["meson"] = "meson" regex = get_variable_regex(variable_format) @@ -1372,10 +1372,10 @@ def do_conf_str_meson(src: str, data: T.List[str], confdata: 'ConfigurationData' return result, missing_variables, confdata_useless def do_conf_str_cmake(src: str, data: T.List[str], confdata: 'ConfigurationData', at_only: bool, subproject: T.Optional[SubProject] = None) -> T.Tuple[T.List[str], T.Set[str], bool]: + + variable_format: Literal["cmake", "cmake@"] = "cmake" if at_only: variable_format = "cmake@" - else: - variable_format = "cmake" regex = get_variable_regex(variable_format)