summaryrefslogtreecommitdiff
path: root/buildstream/plugin.py
diff options
context:
space:
mode:
authorDaniel Silverstone <daniel.silverstone@codethink.co.uk>2018-10-23 16:40:37 +0100
committerDaniel Silverstone <daniel.silverstone@codethink.co.uk>2018-10-25 15:43:52 +0100
commitb4645745b6c327dd5d8e7c22c0fe37c0ae85f73c (patch)
tree5f336f3e4a5f1d9829e512f9a04fa48f54b256a3 /buildstream/plugin.py
parent4f84e2f6dc6f557f287fb380496bb510f3e8ca19 (diff)
downloadbuildstream-b4645745b6c327dd5d8e7c22c0fe37c0ae85f73c.tar.gz
plugin.py: use dict.get() instead of an if statement
Pylint recommends the use of dict.get() rather than a multi-line if statement for handling optional keyword arguments. Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
Diffstat (limited to 'buildstream/plugin.py')
-rw-r--r--buildstream/plugin.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/buildstream/plugin.py b/buildstream/plugin.py
index 65b1b6e9d..9c5c0d8ca 100644
--- a/buildstream/plugin.py
+++ b/buildstream/plugin.py
@@ -751,9 +751,7 @@ class Plugin():
self.__context.message(message)
def __note_command(self, output, *popenargs, **kwargs):
- workdir = os.getcwd()
- if 'cwd' in kwargs:
- workdir = kwargs['cwd']
+ workdir = kwargs.get('cwd', os.getcwd())
command = " ".join(popenargs[0])
output.write('Running host command {}: {}\n'.format(workdir, command))
output.flush()