condense lines

pull/8968/head
Eli Schwartz 4 years ago committed by Jussi Pakkanen
parent b4b488f33c
commit bd6f46e723
  1. 3
      mesonbuild/compilers/detect.py
  2. 3
      mesonbuild/compilers/mixins/gnu.py
  3. 9
      mesonbuild/compilers/mixins/islinker.py
  4. 3
      mesonbuild/dependencies/configtool.py
  5. 3
      mesonbuild/interpreter/interpreter.py
  6. 9
      mesonbuild/interpreterbase/interpreterbase.py
  7. 9
      mesonbuild/linkers/linkers.py
  8. 9
      mesonbuild/mesonlib/universal.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:

@ -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]:

@ -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 []

@ -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)

@ -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)

@ -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,

@ -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]:

@ -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

Loading…
Cancel
Save