From 6a0fabc6472f49621260de215f128a31ae70219b Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Thu, 4 Mar 2021 17:16:11 -0500 Subject: mass rewrite of string formatting to use f-strings everywhere performed by running "pyupgrade --py36-plus" and committing the results --- mesonbuild/compilers/cpp.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mesonbuild/compilers/cpp.py') diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index ebe3a4f..4d55ccd 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -65,7 +65,7 @@ class CPPCompiler(CLikeCompiler, Compiler): try: return CXX_FUNC_ATTRIBUTES.get(name, C_FUNC_ATTRIBUTES[name]) except KeyError: - raise MesonException('Unknown function attribute "{}"'.format(name)) + raise MesonException(f'Unknown function attribute "{name}"') language = 'cpp' @@ -129,10 +129,10 @@ class CPPCompiler(CLikeCompiler, Compiler): CPP_TEST = 'int i = static_cast(0);' with self.compile(CPP_TEST, extra_args=[cpp_std_value], mode='compile') as p: if p.returncode == 0: - mlog.debug('Compiler accepts {}:'.format(cpp_std_value), 'YES') + mlog.debug(f'Compiler accepts {cpp_std_value}:', 'YES') return True else: - mlog.debug('Compiler accepts {}:'.format(cpp_std_value), 'NO') + mlog.debug(f'Compiler accepts {cpp_std_value}:', 'NO') return False @functools.lru_cache() @@ -166,7 +166,7 @@ class CPPCompiler(CLikeCompiler, Compiler): if self._test_cpp_std_arg(cpp_std_value): return cpp_std_value - raise MesonException('C++ Compiler does not support -std={}'.format(cpp_std)) + raise MesonException(f'C++ Compiler does not support -std={cpp_std}') def get_options(self) -> 'KeyedOptionDictType': opts = super().get_options() @@ -615,7 +615,7 @@ class VisualStudioLikeCPPCompilerMixin(CompilerMixinBase): permissive, ver = self.VC_VERSION_MAP[options[key].value] if ver is not None: - args.append('/std:c++{}'.format(ver)) + args.append(f'/std:c++{ver}') if not permissive: args.append('/permissive-') -- cgit v1.1