aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Harder <radhermit@gmail.com>2020-12-24 04:24:52 -0700
committerTim Harder <radhermit@gmail.com>2020-12-24 04:29:45 -0700
commitc2412c04c67163cc02a47a4a4eff13289ccbc268 (patch)
treeb40b65c4134eef5bff38831d146afa2af0c99248 /src/pkgcheck/scripts
parentpkgcheck scan: improve wording for disabled -f/--filter docs (diff)
downloadpkgcheck-c2412c04c67163cc02a47a4a4eff13289ccbc268.tar.gz
pkgcheck-c2412c04c67163cc02a47a4a4eff13289ccbc268.tar.bz2
pkgcheck-c2412c04c67163cc02a47a4a4eff13289ccbc268.zip
Pipeline: fix scope comparisons
Multiprocessing and other cases can cause object recreation so we can't rely on the is operator to work correctly in all situations.
Diffstat (limited to 'src/pkgcheck/scripts')
-rw-r--r--src/pkgcheck/scripts/pkgcheck.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pkgcheck/scripts/pkgcheck.py b/src/pkgcheck/scripts/pkgcheck.py
index d4b7bdff..704db351 100644
--- a/src/pkgcheck/scripts/pkgcheck.py
+++ b/src/pkgcheck/scripts/pkgcheck.py
@@ -526,7 +526,7 @@ def _selected_check(options, scan_scope, scope):
"""Verify check scope against current scan scope to determine check activation."""
if scope == 0:
if not options.selected_scopes:
- if scan_scope is base.repo_scope or scope is scan_scope:
+ if scan_scope == base.repo_scope or scope == scan_scope:
# Allow repo scans or cwd scope to trigger location specific checks.
return True
elif scope in options.selected_scopes:
@@ -538,7 +538,7 @@ def _selected_check(options, scan_scope, scope):
# pkg scanning is requested, e.g. skip repo level checks when scanning at
# package level.
return True
- elif options.commits and scan_scope != 0 and scope is base.commit_scope:
+ elif options.commits and scan_scope != 0 and scope == base.commit_scope:
# Only enable commit-related checks when --commits is specified.
return True
return False