diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-08-17 12:12:16 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-17 14:40:55 +0100 |
commit | 7859f7388f2e3f675d0e1527cfde18625f36f637 (patch) | |
tree | dfc71fa8f3c8d66371d03336731b3015f45caaad /lib/bb/server/process.py | |
parent | 8e9bd559c8ef0ebc9e8babbada06e710908bae08 (diff) | |
download | bitbake-7859f7388f2e3f675d0e1527cfde18625f36f637.tar.gz |
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
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/server/process.py')
-rw-r--r-- | lib/bb/server/process.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py index ef3ee57aa..3198635e2 100644 --- a/lib/bb/server/process.py +++ b/lib/bb/server/process.py @@ -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: |