query: make get_latest_tag() always return a list
When rc=True the reversed() iterator is non-subscriptable, breaking the sorted_tags[-1] fallback path; wrap it in list() to make it indexable. Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
This commit is contained in:
parent
26f20ae51c
commit
ae07040c88
1 changed files with 1 additions and 1 deletions
|
|
@ -187,7 +187,7 @@ class Query:
|
|||
# This excludes release candidates if `rc` is False.
|
||||
def get_latest_tag(self, rc):
|
||||
if rc:
|
||||
sorted_tags = reversed(self.scriptLines('list-tags'))
|
||||
sorted_tags = list(reversed(self.scriptLines('list-tags')))
|
||||
else:
|
||||
sorted_tags = self.scriptLines('get-latest-tags')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue