mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-12-08 16:43:51 +00:00
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.
This commit is contained in:
parent
41e7d2d714
commit
816323ea5c
@ -212,14 +212,14 @@ def get_open_ubuntu_bug_task(launchpad, bug, branch=None):
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
elif len(ubuntu_tasks) == 1:
|
elif len(ubuntu_tasks) == 1:
|
||||||
task = ubuntu_tasks[0]
|
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]]
|
tasks = [t for t in ubuntu_tasks if t.get_series() == branch[2] and t.package == branch[3]]
|
||||||
if len(tasks) > 1:
|
if len(tasks) > 1:
|
||||||
# A bug targeted to the development series?
|
# A bug targeted to the development series?
|
||||||
tasks = [t for t in tasks if t.series is not None]
|
tasks = [t for t in tasks if t.series is not None]
|
||||||
assert len(tasks) == 1
|
assert len(tasks) == 1
|
||||||
task = tasks[0]
|
task = tasks[0]
|
||||||
elif len(ubuntu_tasks) > 1:
|
else:
|
||||||
task_list = [t.get_short_info() for t in ubuntu_tasks]
|
task_list = [t.get_short_info() for t in ubuntu_tasks]
|
||||||
Logger.debug(
|
Logger.debug(
|
||||||
"%i Ubuntu tasks exist for bug #%i.\n%s",
|
"%i Ubuntu tasks exist for bug #%i.\n%s",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user