1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 00:20:08 +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
+3 -1
View File
@@ -124,8 +124,10 @@ class ProcessServer(Process, BaseImplServer):
self.command_channel.close()
self.cooker.shutdown(True)
def idle_commands(self, delay, fds = []):
def idle_commands(self, delay, fds=None):
nextsleep = delay
if not fds:
fds = []
for function, data in self._idlefuns.items():
try:
+5 -2
View File
@@ -281,12 +281,15 @@ class XMLRPCServer(SimpleXMLRPCServer, BaseImplServer):
self.connection_token = token
class BitBakeXMLRPCServerConnection(BitBakeBaseServerConnection):
def __init__(self, serverImpl, clientinfo=("localhost", 0), observer_only = False, featureset = []):
def __init__(self, serverImpl, clientinfo=("localhost", 0), observer_only = False, featureset = None):
self.connection, self.transport = _create_server(serverImpl.host, serverImpl.port)
self.clientinfo = clientinfo
self.serverImpl = serverImpl
self.observer_only = observer_only
self.featureset = featureset
if featureset:
self.featureset = featureset
else:
self.featureset = []
def connect(self, token = None):
if token is None: