1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-01 13:09:50 +00:00

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>
This commit is contained in:
Paul Eggleton
2015-08-17 12:12:16 +01:00
committed by Richard Purdie
parent 22a653d028
commit 715d857174
10 changed files with 58 additions and 31 deletions
+2 -2
View File
@@ -176,7 +176,7 @@ def fire_from_worker(event, d):
fire_ui_handlers(event, d)
noop = lambda _: None
def register(name, handler, mask=[]):
def register(name, handler, mask=None):
"""Register an Event handler"""
# already registered
@@ -389,7 +389,7 @@ class DiskFull(Event):
class NoProvider(Event):
"""No Provider for an Event"""
def __init__(self, item, runtime=False, dependees=None, reasons=[], close_matches=[]):
def __init__(self, item, runtime=False, dependees=None, reasons=None, close_matches=None):
Event.__init__(self)
self._item = item
self._runtime = runtime