summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/server/xmlrpc.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/bb/server/xmlrpc.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/bb/server/xmlrpc.py')
-rw-r--r--bitbake/lib/bb/server/xmlrpc.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/bitbake/lib/bb/server/xmlrpc.py b/bitbake/lib/bb/server/xmlrpc.py
index 75ec8556f4..f1a2067246 100644
--- a/bitbake/lib/bb/server/xmlrpc.py
+++ b/bitbake/lib/bb/server/xmlrpc.py
@@ -281,12 +281,15 @@ class XMLRPCServer(SimpleXMLRPCServer, BaseImplServer):
281 self.connection_token = token 281 self.connection_token = token
282 282
283class BitBakeXMLRPCServerConnection(BitBakeBaseServerConnection): 283class BitBakeXMLRPCServerConnection(BitBakeBaseServerConnection):
284 def __init__(self, serverImpl, clientinfo=("localhost", 0), observer_only = False, featureset = []): 284 def __init__(self, serverImpl, clientinfo=("localhost", 0), observer_only = False, featureset = None):
285 self.connection, self.transport = _create_server(serverImpl.host, serverImpl.port) 285 self.connection, self.transport = _create_server(serverImpl.host, serverImpl.port)
286 self.clientinfo = clientinfo 286 self.clientinfo = clientinfo
287 self.serverImpl = serverImpl 287 self.serverImpl = serverImpl
288 self.observer_only = observer_only 288 self.observer_only = observer_only
289 self.featureset = featureset 289 if featureset:
290 self.featureset = featureset
291 else:
292 self.featureset = []
290 293
291 def connect(self, token = None): 294 def connect(self, token = None):
292 if token is None: 295 if token is None: