aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/mixins/clike.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2021-03-04 17:02:31 -0500
committerEli Schwartz <eschwartz@archlinux.org>2021-03-04 17:11:26 -0500
commit4340bf34faca7eed8076ba4c388fbe15355f2183 (patch)
tree6082548a6cb79091d1059a73e7b3b9f59657f6d9 /mesonbuild/compilers/mixins/clike.py
parent76df995ba69ef5d790462856b3edbd42b28b906a (diff)
downloadmeson-4340bf34faca7eed8076ba4c388fbe15355f2183.zip
meson-4340bf34faca7eed8076ba4c388fbe15355f2183.tar.gz
meson-4340bf34faca7eed8076ba4c388fbe15355f2183.tar.bz2
various python neatness cleanups
All changes were created by running "pyupgrade --py3-only --keep-percent-format" and committing the results. I have not touched string formatting for now. - use set literals - simplify .format() parameter naming - remove __future__ - remove default "r" mode for open() - use OSError rather than compatibility aliases - remove stray parentheses in function(generator) scopes
Diffstat (limited to 'mesonbuild/compilers/mixins/clike.py')
-rw-r--r--mesonbuild/compilers/mixins/clike.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py
index ad3bfae..ad0e257 100644
--- a/mesonbuild/compilers/mixins/clike.py
+++ b/mesonbuild/compilers/mixins/clike.py
@@ -321,7 +321,7 @@ class CLikeCompiler(Compiler):
mlog.debug(stde)
mlog.debug('-----')
if pc.returncode != 0:
- raise mesonlib.EnvironmentException('Compiler {0} can not compile programs.'.format(self.name_string()))
+ raise mesonlib.EnvironmentException('Compiler {} can not compile programs.'.format(self.name_string()))
# Run sanity check
if self.is_cross:
if self.exe_wrapper is None:
@@ -337,7 +337,7 @@ class CLikeCompiler(Compiler):
raise mesonlib.EnvironmentException('Could not invoke sanity test executable: %s.' % str(e))
pe.wait()
if pe.returncode != 0:
- raise mesonlib.EnvironmentException('Executables created by {0} compiler {1} are not runnable.'.format(self.language, self.name_string()))
+ raise mesonlib.EnvironmentException('Executables created by {} compiler {} are not runnable.'.format(self.language, self.name_string()))
def sanity_check(self, work_dir: str, environment: 'Environment') -> None:
code = 'int main(void) { int class=0; return class; }\n'
@@ -810,7 +810,7 @@ class CLikeCompiler(Compiler):
if val is not None:
if isinstance(val, bool):
return val, False
- raise mesonlib.EnvironmentException('Cross variable {0} is not a boolean.'.format(varname))
+ raise mesonlib.EnvironmentException('Cross variable {} is not a boolean.'.format(varname))
# TODO: we really need a protocol for this,
#