Safeguard List._sort_bugs from accumulating values in its default parameters.
authorRobert Lehmann <mail@robertlehmann.de>
Fri, 26 Nov 2010 08:47:46 +0000 (09:47 +0100)
committerRobert Lehmann <mail@robertlehmann.de>
Fri, 26 Nov 2010 08:47:46 +0000 (09:47 +0100)
libbe/command/list.py

index f348d5cb6cee0154b0dec068907a09a6600266da..2611692a4ff5b270858cc4928a8601454dad9372 100644 (file)
@@ -179,7 +179,9 @@ class List (libbe.command.Command):
                                      for x in params['extra-strings'].split(',')]
         return (cmp_list, status, severity, assigned, extra_strings_regexps)
 
-    def _sort_bugs(self, bugs, cmp_list=[]):
+    def _sort_bugs(self, bugs, cmp_list=None):
+        if cmp_list is None:
+            cmp_list = []
         cmp_list.extend(libbe.bug.DEFAULT_CMP_FULL_CMP_LIST)
         cmp_fn = libbe.bug.BugCompoundComparator(cmp_list=cmp_list)
         bugs.sort(cmp_fn)