aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/cmake.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/modules/cmake.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/modules/cmake.py')
-rw-r--r--mesonbuild/modules/cmake.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/modules/cmake.py b/mesonbuild/modules/cmake.py
index dc45e71..18dc2f5 100644
--- a/mesonbuild/modules/cmake.py
+++ b/mesonbuild/modules/cmake.py
@@ -235,7 +235,7 @@ class CmakeModule(ExtensionModule):
cmakebin = dependencies.ExternalProgram('cmake', silent=False)
p, stdout, stderr = mesonlib.Popen_safe(cmakebin.get_command() + ['--system-information', '-G', 'Ninja'])[0:3]
if p.returncode != 0:
- mlog.log('error retrieving cmake information: returnCode={0} stdout={1} stderr={2}'.format(p.returncode, stdout, stderr))
+ mlog.log('error retrieving cmake information: returnCode={} stdout={} stderr={}'.format(p.returncode, stdout, stderr))
return False
match = re.search('\nCMAKE_ROOT \\"([^"]+)"\n', stdout.strip())
@@ -295,7 +295,7 @@ class CmakeModule(ExtensionModule):
package_init += PACKAGE_INIT_SET_AND_CHECK
try:
- with open(infile, "r") as fin:
+ with open(infile) as fin:
data = fin.readlines()
except Exception as e:
raise mesonlib.MesonException('Could not read input file %s: %s' % (infile, str(e)))