From 4d7031437c7a81b52c776d4ae1e32741bdb851ca Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 31 Aug 2021 09:55:01 -0700 Subject: pylint: turn on superflous-parens We have a lot of these. Some of them are harmless, if unidiomatic, such as `if (condition)`, others are potentially dangerous `assert(...)`, as `assert(condtion)` works as expected, but `assert(condition, message)` will result in an assertion that never triggers, as what you're actually asserting is `bool(tuple[2])`, which will always be true. --- mesonbuild/mesonlib/universal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mesonbuild/mesonlib/universal.py') diff --git a/mesonbuild/mesonlib/universal.py b/mesonbuild/mesonlib/universal.py index b807377..63e754b 100644 --- a/mesonbuild/mesonlib/universal.py +++ b/mesonbuild/mesonlib/universal.py @@ -1059,7 +1059,7 @@ if is_windows(): if c == '\\': num_backslashes += 1 else: - if c == '"' and not (num_backslashes % 2): + if c == '"' and not num_backslashes % 2: # unescaped quote, eat it arg += (num_backslashes // 2) * '\\' num_quotes += 1 -- cgit v1.1