From 4340bf34faca7eed8076ba4c388fbe15355f2183 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Thu, 4 Mar 2021 17:02:31 -0500 Subject: 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 --- mesonbuild/modules/python.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mesonbuild/modules/python.py') diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py index cfe2244..d05c72a 100644 --- a/mesonbuild/modules/python.py +++ b/mesonbuild/modules/python.py @@ -36,9 +36,9 @@ from ..dependencies.base import ( NonExistingExternalProgram, NotFoundDependency ) -mod_kwargs = set(['subdir']) +mod_kwargs = {'subdir'} mod_kwargs.update(known_shmod_kwargs) -mod_kwargs -= set(['name_prefix', 'name_suffix']) +mod_kwargs -= {'name_prefix', 'name_suffix'} class PythonDependency(ExternalDependency): @@ -544,7 +544,7 @@ class PythonModule(ExtensionModule): for mod in want_modules: p, out, err = mesonlib.Popen_safe( python.command + - ['-c', 'import {0}'.format(mod)]) + ['-c', 'import {}'.format(mod)]) if p.returncode != 0: missing_modules.append(mod) else: -- cgit v1.1