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. --- ghwt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ghwt.py') diff --git a/ghwt.py b/ghwt.py index 6f9373b..fc6db5d 100755 --- a/ghwt.py +++ b/ghwt.py @@ -45,7 +45,7 @@ def unpack(sproj, branch): shutil.rmtree(tmpdir, ignore_errors=True) subprocess.check_call(['git', 'clone', '-b', branch, f'https://github.com/mesonbuild/{sproj}.git', tmpdir]) usfile = os.path.join(tmpdir, 'upstream.wrap') - assert(os.path.isfile(usfile)) + assert os.path.isfile(usfile) config = configparser.ConfigParser(interpolation=None) config.read(usfile) outdir = os.path.join(spdir, sproj) @@ -74,7 +74,7 @@ def unpack(sproj, branch): shutil.unpack_archive(ofilename, outdir) else: shutil.unpack_archive(ofilename, spdir) - assert(os.path.isdir(outdir)) + assert os.path.isdir(outdir) shutil.move(os.path.join(tmpdir, '.git'), outdir) subprocess.check_call(['git', 'reset', '--hard'], cwd=outdir) shutil.rmtree(tmpdir) -- cgit v1.1