aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2021-07-04 19:18:28 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2021-07-05 17:55:04 +0300
commitbd6f46e723813dfadaba1f7c87d3b0b751d05219 (patch)
tree4e5114bd99e249f474023c505b8c388c73bde255 /mesonbuild
parentb4b488f33cb6da1d840371039d6cf2c76f91ea9b (diff)
downloadmeson-bd6f46e723813dfadaba1f7c87d3b0b751d05219.zip
meson-bd6f46e723813dfadaba1f7c87d3b0b751d05219.tar.gz
meson-bd6f46e723813dfadaba1f7c87d3b0b751d05219.tar.bz2
condense lines
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/compilers/detect.py3
-rw-r--r--mesonbuild/compilers/mixins/gnu.py3
-rw-r--r--mesonbuild/compilers/mixins/islinker.py9
-rw-r--r--mesonbuild/dependencies/configtool.py3
-rw-r--r--mesonbuild/interpreter/interpreter.py3
-rw-r--r--mesonbuild/interpreterbase/interpreterbase.py9
-rw-r--r--mesonbuild/linkers/linkers.py9
-rw-r--r--mesonbuild/mesonlib/universal.py9
8 files changed, 16 insertions, 32 deletions
diff --git a/mesonbuild/compilers/detect.py b/mesonbuild/compilers/detect.py
index 78a4be8..cd0f252 100644
--- a/mesonbuild/compilers/detect.py
+++ b/mesonbuild/compilers/detect.py
@@ -548,8 +548,7 @@ def _detect_c_or_cpp_compiler(env: 'Environment', lang: str, for_machine: Machin
if version != 'unknown version':
break
else:
- m = f'Failed to detect MSVC compiler version: stderr was\n{err!r}'
- raise EnvironmentException(m)
+ raise EnvironmentException(f'Failed to detect MSVC compiler version: stderr was\n{err!r}')
cl_signature = lookat.split('\n')[0]
match = re.search(r'.*(x86|x64|ARM|ARM64)([^_A-Za-z0-9]|$)', cl_signature)
if match:
diff --git a/mesonbuild/compilers/mixins/gnu.py b/mesonbuild/compilers/mixins/gnu.py
index a4e73d2..5d915f3 100644
--- a/mesonbuild/compilers/mixins/gnu.py
+++ b/mesonbuild/compilers/mixins/gnu.py
@@ -316,8 +316,7 @@ class GnuLikeCompiler(Compiler, metaclass=abc.ABCMeta):
def use_linker_args(cls, linker: str) -> T.List[str]:
if linker not in {'gold', 'bfd', 'lld'}:
raise mesonlib.MesonException(
- 'Unsupported linker, only bfd, gold, and lld are supported, '
- f'not {linker}.')
+ 'Unsupported linker, only bfd, gold, and lld are supported, not {linker}.')
return [f'-fuse-ld={linker}']
def get_coverage_args(self) -> T.List[str]:
diff --git a/mesonbuild/compilers/mixins/islinker.py b/mesonbuild/compilers/mixins/islinker.py
index 250d55b..4c29f8c 100644
--- a/mesonbuild/compilers/mixins/islinker.py
+++ b/mesonbuild/compilers/mixins/islinker.py
@@ -82,16 +82,13 @@ class BasicLinkerIsCompilerMixin(Compiler):
return self.get_std_shared_lib_link_args()
def get_link_whole_for(self, args: T.List[str]) -> T.List[str]:
- raise EnvironmentException(
- f'Linker {self.id} does not support link_whole')
+ raise EnvironmentException(f'Linker {self.id} does not support link_whole')
def get_allow_undefined_link_args(self) -> T.List[str]:
- raise EnvironmentException(
- f'Linker {self.id} does not support allow undefined')
+ raise EnvironmentException(f'Linker {self.id} does not support allow undefined')
def get_pie_link_args(self) -> T.List[str]:
- m = f'Linker {self.id} does not support position-independent executable'
- raise EnvironmentException(m)
+ raise EnvironmentException(f'Linker {self.id} does not support position-independent executable')
def get_undefined_link_args(self) -> T.List[str]:
return []
diff --git a/mesonbuild/dependencies/configtool.py b/mesonbuild/dependencies/configtool.py
index 788afa3..623affb 100644
--- a/mesonbuild/dependencies/configtool.py
+++ b/mesonbuild/dependencies/configtool.py
@@ -134,8 +134,7 @@ class ConfigToolDependency(ExternalDependency):
p, out, err = Popen_safe(self.config + args)
if p.returncode != 0:
if self.required:
- raise DependencyException(
- f'Could not generate {stage} for {self.name}.\n{err}')
+ raise DependencyException(f'Could not generate {stage} for {self.name}.\n{err}')
return []
return split_args(out)
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index f066864..daef5fd 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -2448,8 +2448,7 @@ This will become a hard error in the future.''' % kwargs['input'], location=self
args_frozen: bool, args: T.List[str], kwargs: 'kwargs.FuncAddProjectArgs') -> None:
if args_frozen:
msg = f'Tried to use \'{node.func_name}\' after a build target has been declared.\n' \
- 'This is not permitted. Please declare all ' \
- 'arguments before your targets.'
+ 'This is not permitted. Please declare all arguments before your targets.'
raise InvalidCode(msg)
self._warn_about_builtin_args(args)
diff --git a/mesonbuild/interpreterbase/interpreterbase.py b/mesonbuild/interpreterbase/interpreterbase.py
index 5204813..b8a6d1a 100644
--- a/mesonbuild/interpreterbase/interpreterbase.py
+++ b/mesonbuild/interpreterbase/interpreterbase.py
@@ -675,13 +675,11 @@ The result of this is undefined and will become a hard error in a future Meson r
@staticmethod
def _get_one_string_posarg(posargs: T.List[TYPE_var], method_name: str) -> str:
if len(posargs) > 1:
- m = f'{method_name}() must have zero or one arguments'
- raise InterpreterException(m)
+ raise InterpreterException(f'{method_name}() must have zero or one arguments')
elif len(posargs) == 1:
s = posargs[0]
if not isinstance(s, str):
- m = f'{method_name}() argument must be a string'
- raise InterpreterException(m)
+ raise InterpreterException(f'{method_name}() argument must be a string')
return s
return None
@@ -820,8 +818,7 @@ The result of this is undefined and will become a hard error in a future Meson r
return self.evaluate_statement(fallback)
return fallback
return obj[index]
- m = f'Arrays do not have a method called {method_name!r}.'
- raise InterpreterException(m)
+ raise InterpreterException(f'Arrays do not have a method called {method_name!r}.')
@builtinMethodNoKwargs
def dict_method_call(self,
diff --git a/mesonbuild/linkers/linkers.py b/mesonbuild/linkers/linkers.py
index 4b64069..c26edda 100644
--- a/mesonbuild/linkers/linkers.py
+++ b/mesonbuild/linkers/linkers.py
@@ -407,8 +407,7 @@ class DynamicLinker(metaclass=abc.ABCMeta):
return []
def has_multi_arguments(self, args: T.List[str], env: 'Environment') -> T.Tuple[bool, bool]:
- m = f'Language {self.id} does not support has_multi_link_arguments.'
- raise EnvironmentException(m)
+ raise EnvironmentException(f'Language {self.id} does not support has_multi_link_arguments.')
def get_debugfile_name(self, targetfile: str) -> str:
'''Name of debug file written out (see below)'''
@@ -433,8 +432,7 @@ class DynamicLinker(metaclass=abc.ABCMeta):
# TODO: this really needs to take a boolean and return the args to
# disable pie, otherwise it only acts to enable pie if pie *isn't* the
# default.
- m = f'Linker {self.id} does not support position-independent executable'
- raise EnvironmentException(m)
+ raise EnvironmentException(f'Linker {self.id} does not support position-independent executable')
def get_lto_args(self) -> T.List[str]:
return []
@@ -463,8 +461,7 @@ class DynamicLinker(metaclass=abc.ABCMeta):
pass
def get_coverage_args(self) -> T.List[str]:
- m = f"Linker {self.id} doesn't implement coverage data generation."
- raise EnvironmentException(m)
+ raise EnvironmentException(f"Linker {self.id} doesn't implement coverage data generation.")
@abc.abstractmethod
def get_search_args(self, dirname: str) -> T.List[str]:
diff --git a/mesonbuild/mesonlib/universal.py b/mesonbuild/mesonlib/universal.py
index d57c3e8..17f604d 100644
--- a/mesonbuild/mesonlib/universal.py
+++ b/mesonbuild/mesonlib/universal.py
@@ -330,11 +330,9 @@ class FileMode:
return -1
eg = 'rwxr-xr-x'
if not isinstance(perms_s, str):
- msg = f'Install perms must be a string. For example, {eg!r}'
- raise MesonException(msg)
+ raise MesonException(f'Install perms must be a string. For example, {eg!r}')
if len(perms_s) != 9 or not cls.symbolic_perms_regex.match(perms_s):
- msg = f'File perms {perms_s!r} must be exactly 9 chars. For example, {eg!r}'
- raise MesonException(msg)
+ raise MesonException(f'File perms {perms_s!r} must be exactly 9 chars. For example, {eg!r}')
perms = 0
# Owner perms
if perms_s[0] == 'r':
@@ -1451,8 +1449,7 @@ def _substitute_values_check_errors(command: T.List[str], values: T.Dict[str, st
# Error out if any input-derived templates are present in the command
match = iter_regexin_iter(inregex, command)
if match:
- m = f'Command cannot have {match!r}, since no input files were specified'
- raise MesonException(m)
+ raise MesonException(f'Command cannot have {match!r}, since no input files were specified')
else:
if len(values['@INPUT@']) > 1:
# Error out if @PLAINNAME@ or @BASENAME@ is present in the command