Handle E712 - don't compare with == to Booleans

This commit is contained in:
Stephan Kulow 2022-02-18 16:34:48 +01:00
parent 1383ae9725
commit a8623bb8d8
4 changed files with 7 additions and 7 deletions

View File

@ -1,4 +1,4 @@
[flake8]
exclude = abichecker
max-line-length = 100
ignore = W503,W504,E501,F401,E128,E251,E201,E202,E302,E305,F841,E261,E712
ignore = W503,W504,E501,F401,E128,E251,E201,E202,E302,E305,F841,E261

View File

@ -295,7 +295,7 @@ class ReviewBot(object):
elif self.review_mode == 'fallback-always':
self.add_review(req, by_group=by_group, by_user=by_user, msg='Adding fallback reviewer')
if doit == True:
if doit:
self.logger.debug("setting %s to %s" % (req.reqid, state))
if not self.dryrun:
try:

View File

@ -272,18 +272,18 @@ class BiArchTool(ToolBase.ToolBase):
else:
must_disable = True
if must_disable == False:
if not must_disable:
if is_disabled:
logger.info('enabling %s for %s', pkg, self.arch)
for build in pkgmeta.findall("./build"):
for n in build.findall("./disable[@arch='{}']".format(self.arch)):
build.remove(n)
changed = True
if changed == False:
if not changed:
logger.error('build tag not found in %s/%s!?', pkg, self.arch)
else:
logger.debug('%s already enabled for %s', pkg, self.arch)
elif must_disable == True:
elif must_disable:
if not is_disabled:
logger.info('disabling %s for %s', pkg, self.arch)
bn = pkgmeta.find('build')
@ -300,7 +300,7 @@ class BiArchTool(ToolBase.ToolBase):
for n in build.findall("./enable[@arch='{}']".format(self.arch)):
build.remove(n)
changed = True
if changed == False:
if not changed:
logger.error('build tag not found in %s/%s!?', pkg, self.arch)
if changed:

View File

@ -80,7 +80,7 @@ class DepTool(cmdln.Cmdln):
name = r
r += '.repo'
parser.read('/'.join((repodir, r)))
if onlyenabled == False or parser.get(name, 'enabled') == '1':
if onlyenabled is False or parser.get(name, 'enabled') == '1':
repo = self.pool.add_repo(name)
repo.add_solv(solvfile % name)
if parser.has_option(name, 'priority'):