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/optinterpreter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mesonbuild/optinterpreter.py') diff --git a/mesonbuild/optinterpreter.py b/mesonbuild/optinterpreter.py index dc8c3ce5c..60436911b 100644 --- a/mesonbuild/optinterpreter.py +++ b/mesonbuild/optinterpreter.py @@ -142,7 +142,7 @@ class OptionInterpreter: def process(self, option_file: str) -> None: try: - with open(option_file, 'r', encoding='utf8') as f: + with open(option_file, encoding='utf8') as f: ast = mparser.Parser(f.read(), option_file).parse() except mesonlib.MesonException as me: me.file = option_file -- cgit v1.2.1