From ef5e3d80666387621b722f29624170125a2b0dfc Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Wed, 3 Dec 2025 13:32:33 +0100 Subject: [PATCH] requestsync: silence possibly-used-before-assignment pylint complains: ``` requestsync:156:34: E0606: Possibly using variable 'bug_mail_domain' before assignment (possibly-used-before-assignment) requestsync:217:27: E0606: Possibly using variable 'Distribution' before assignment (possibly-used-before-assignment) requestsync:380:8: E0606: Possibly using variable 'post_bug' before assignment (possibly-used-before-assignment) ``` These errors are false positives. So silence them. The perfect solution would be to restructure the code. --- requestsync | 3 +++ 1 file changed, 3 insertions(+) diff --git a/requestsync b/requestsync index 11ba9ea..e86a053 100755 --- a/requestsync +++ b/requestsync @@ -153,6 +153,7 @@ def main(): import DNS # pylint: disable=import-outside-toplevel DNS.DiscoverNameServers() + # imported earlier, pylint: disable-next=possibly-used-before-assignment mxlist = DNS.mxlookup(bug_mail_domain) firstmx = mxlist[0] mailserver_host = firstmx[1] @@ -214,6 +215,7 @@ def main(): if not args.release: if lpapi: + # imported earlier, pylint: disable-next=possibly-used-before-assignment args.release = Distribution("ubuntu").getDevelopmentSeries().name else: ubu_info = UbuntuDistroInfo() @@ -377,6 +379,7 @@ def main(): # Map status to the values expected by LP API mapping = {"new": "New", "confirmed": "Confirmed"} # Post sync request using LP API + # imported earlier, pylint: disable-next=possibly-used-before-assignment post_bug(srcpkg, subscribe, mapping[status], title, report) else: email_from = ubu_email(export=False)[1]