From 3f985627a1fb359ba3a084ab43897b25e5498291 Mon Sep 17 00:00:00 2001 From: Nils Philippsen Date: Nov 26 2019 08:42:26 +0000 Subject: initialize self.errors in run() Initializing it to a (default)dict could cause problems if several instances are used. We don't do that at the moment, but it's bad practice to initialize class members to mutable data types which aren't supposed to be shared between instances. Signed-off-by: Nils Philippsen --- diff --git a/distgit_bugzilla_sync/script.py b/distgit_bugzilla_sync/script.py index 2915bc4..83cd92b 100644 --- a/distgit_bugzilla_sync/script.py +++ b/distgit_bugzilla_sync/script.py @@ -501,7 +501,6 @@ class DistgitBugzillaSync: _namespace_to_product = None _product_to_branch_regex = None _branch_regex_to_product = None - errors = collections.defaultdict(list) def send_email(self, from_address, to_address, subject, message, cc_address=None): '''Send an email if there's an error. @@ -849,7 +848,7 @@ class DistgitBugzillaSync: self.env["print-no-change"] = self.args.print_no_change # Non-fatal errors to alert people about - errors = [] + self.errors = collections.defaultdict(list) self.session = retry_session()