summaryrefslogtreecommitdiff
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
parenta4a302bbf08415af34c804546f4e491e41dcee29 (diff)
downloadbuildstream-1ba6167b8fc86964bfb0f12f266eb25b8233e194.tar.gz
pylint - dealt with dangerous-default-value warning
-rw-r--r--.pylintrc1
-rw-r--r--buildstream/_artifactcache/pushreceive.py4
-rw-r--r--buildstream/_yaml.py4
3 files changed, 4 insertions, 5 deletions
diff --git a/.pylintrc b/.pylintrc
index a45c41c73..f028212c0 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -112,7 +112,6 @@ disable=#####################################
# Messages that report warnings which should be addressed #
###########################################################
- dangerous-default-value,
global-statement,
len-as-condition,
logging-format-interpolation,
diff --git a/buildstream/_artifactcache/pushreceive.py b/buildstream/_artifactcache/pushreceive.py
index 63adeb153..b23dc1a84 100644
--- a/buildstream/_artifactcache/pushreceive.py
+++ b/buildstream/_artifactcache/pushreceive.py
@@ -392,7 +392,7 @@ class ProcessWithPipes(object):
class OSTreePusher(object):
- def __init__(self, repopath, remotepath, branches=[], verbose=False,
+ def __init__(self, repopath, remotepath, branches=None, verbose=False,
debug=False, output=None):
self.repopath = repopath
self.remotepath = remotepath
@@ -410,7 +410,7 @@ class OSTreePusher(object):
self.repo.open(None)
# Enumerate branches to push
- if len(branches) == 0:
+ if branches is None:
_, self.refs = self.repo.list_refs(None, None)
else:
self.refs = {}
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: