summaryrefslogtreecommitdiff
path: root/buildstream/_yaml.py
diff options
context:
space:
mode:
authorJames Ennis <james.ennis@codethink.com>2018-02-14 15:11:44 +0000
committerJames Ennis <james.ennis@codethink.com>2018-03-14 14:10:26 +0000
commit1ba6167b8fc86964bfb0f12f266eb25b8233e194 (patch)
tree5ad44dcf0263367b991035a4167914c183a34eef /buildstream/_yaml.py
parenta4a302bbf08415af34c804546f4e491e41dcee29 (diff)
downloadbuildstream-1ba6167b8fc86964bfb0f12f266eb25b8233e194.tar.gz
pylint - dealt with dangerous-default-value warning
Diffstat (limited to 'buildstream/_yaml.py')
-rw-r--r--buildstream/_yaml.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/buildstream/_yaml.py b/buildstream/_yaml.py
index 2e29f5e18..718f7321b 100644
--- a/buildstream/_yaml.py
+++ b/buildstream/_yaml.py
@@ -325,7 +325,7 @@ def node_get_provenance(node, key=None, indices=None):
# Note:
# Returned strings are stripped of leading and trailing whitespace
#
-def node_get(node, expected_type, key, indices=[], default_value=None):
+def node_get(node, expected_type, key, indices=None, default_value=None):
value = node.get(key, default_value)
provenance = node_get_provenance(node)
if value is None:
@@ -333,7 +333,7 @@ def node_get(node, expected_type, key, indices=[], default_value=None):
"{}: Dictionary did not contain expected key '{}'".format(provenance, key))
path = key
- if indices:
+ if indices is not None:
# Implied type check of the element itself
value = node_get(node, list, key)
for index in indices: