aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Warner <antarus@gentoo.org>2020-07-29 11:27:16 -0700
committerZac Medico <zmedico@gentoo.org>2020-07-29 21:05:06 -0700
commit709826c0896120e8b3d9995d71678c0b9b290e4c (patch)
treea1864886deaa849c8391dbc4427a2b6ede74a589 /lib/portage/glsa.py
parentSilence 'mixed-indentation' warning. (diff)
downloadportage-709826c0896120e8b3d9995d71678c0b9b290e4c.tar.gz
portage-709826c0896120e8b3d9995d71678c0b9b290e4c.tar.bz2
portage-709826c0896120e8b3d9995d71678c0b9b290e4c.zip
Fix R1705.
The codebase appears to have this pattern like: if foo == bar: return a elif foo == baz: return b else: return c This can often be rewritten as: if foo == bar: return a if foo == baz: return b return c Closes: https://github.com/gentoo/portage/pull/592 Signed-off-by: Alec Warner <antarus@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'lib/portage/glsa.py')
-rw-r--r--lib/portage/glsa.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/portage/glsa.py b/lib/portage/glsa.py
index ecbcde8f4..4066d6747 100644
--- a/lib/portage/glsa.py
+++ b/lib/portage/glsa.py
@@ -293,10 +293,9 @@ def match(atom, dbapi, match_type="default"):
"""
if atom[2] == "~":
return revisionMatch(atom, dbapi, match_type=match_type)
- elif match_type == "default" or not hasattr(dbapi, "xmatch"):
+ if match_type == "default" or not hasattr(dbapi, "xmatch"):
return dbapi.match(atom)
- else:
- return dbapi.xmatch(match_type, atom)
+ return dbapi.xmatch(match_type, atom)
def revisionMatch(revisionAtom, dbapi, match_type="default"):
"""