summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/views.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-08-17 12:12:16 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-19 18:05:44 +0100
commit715d857174ceca82b85d6c8c7df520047ba7fb0c (patch)
tree363aac81a06b013471f1dede8ba4c0dc7d8bbe92 /bitbake/lib/toaster/toastergui/views.py
parent22a653d02880c35d3c9d04811c31aabdf1e69951 (diff)
downloadpoky-715d857174ceca82b85d6c8c7df520047ba7fb0c.tar.gz
bitbake: Fix default function parameter assignment to a list
With python you should not assign a list as the default value of a function parameter - because a list is mutable, the result will be that the first time a value is passed it will actually modify the default. Reference: http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments (Bitbake rev: 7859f7388f2e3f675d0e1527cfde18625f36f637) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 889b6c64ca..d29ddd6099 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -522,7 +522,9 @@ def builddashboard( request, build_id ):
522 522
523 523
524 524
525def generateCoveredList2( revlist = [] ): 525def generateCoveredList2( revlist = None ):
526 if not revlist:
527 revlist = []
526 covered_list = [ x for x in revlist if x.outcome == Task.OUTCOME_COVERED ] 528 covered_list = [ x for x in revlist if x.outcome == Task.OUTCOME_COVERED ]
527 while len(covered_list): 529 while len(covered_list):
528 revlist = [ x for x in revlist if x.outcome != Task.OUTCOME_COVERED ] 530 revlist = [ x for x in revlist if x.outcome != Task.OUTCOME_COVERED ]