From 816323ea5c52adf9c5649f9ae6bee022481f4106 Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Wed, 3 Dec 2025 13:21:19 +0100 Subject: [PATCH] sponsor_patch: make pylint happy pylint complains: ``` ubuntutools/sponsor_patch/sponsor_patch.py:243:45: E0606: Possibly using variable 'task' before assignment (possibly-used-before-assignment) ``` Drop the `len(ubuntu_tasks) > 1` check and rely on being the else case. --- ubuntutools/sponsor_patch/sponsor_patch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ubuntutools/sponsor_patch/sponsor_patch.py b/ubuntutools/sponsor_patch/sponsor_patch.py index 602fd51..7747372 100644 --- a/ubuntutools/sponsor_patch/sponsor_patch.py +++ b/ubuntutools/sponsor_patch/sponsor_patch.py @@ -212,14 +212,14 @@ def get_open_ubuntu_bug_task(launchpad, bug, branch=None): sys.exit(1) elif len(ubuntu_tasks) == 1: task = ubuntu_tasks[0] - if len(ubuntu_tasks) > 1 and branch and branch[1] == "ubuntu": + elif branch and branch[1] == "ubuntu": tasks = [t for t in ubuntu_tasks if t.get_series() == branch[2] and t.package == branch[3]] if len(tasks) > 1: # A bug targeted to the development series? tasks = [t for t in tasks if t.series is not None] assert len(tasks) == 1 task = tasks[0] - elif len(ubuntu_tasks) > 1: + else: task_list = [t.get_short_info() for t in ubuntu_tasks] Logger.debug( "%i Ubuntu tasks exist for bug #%i.\n%s",