summaryrefslogtreecommitdiff
path: root/src/buildstream/node.pyx
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-07-12 10:05:45 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-07-15 14:14:03 +0000
commitd474b763a299d5f2be2fc7c6bcc5cb396988f66e (patch)
tree77e72532615bb04646772f34b9c3842920ed8957 /src/buildstream/node.pyx
parent2c7674169ab3368b7f2353ce04ba5b8692608867 (diff)
downloadbuildstream-d474b763a299d5f2be2fc7c6bcc5cb396988f66e.tar.gz
node: Mark `MappingNode._get` as private
Diffstat (limited to 'src/buildstream/node.pyx')
-rw-r--r--src/buildstream/node.pyx34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/buildstream/node.pyx b/src/buildstream/node.pyx
index d20ff664f..48339bafd 100644
--- a/src/buildstream/node.pyx
+++ b/src/buildstream/node.pyx
@@ -570,23 +570,6 @@ cdef class MappingNode(Node):
else:
target.value["(>)"] = suffix
- cdef Node _get(self, str key, object default, object default_constructor):
- value = self.value.get(key, _sentinel)
-
- if value is _sentinel:
- if default is _sentinel:
- provenance = self.get_provenance()
- raise LoadError(LoadErrorReason.INVALID_DATA,
- "{}: Dictionary did not contain expected key '{}'".format(provenance, key))
-
- if default is None:
- value = None
- else:
- value = default_constructor.__new__(
- default_constructor, _SYNTHETIC_FILE_INDEX, 0, next_synthetic_counter(), default)
-
- return value
-
cdef bint _is_composite_list(self) except *:
cdef bint has_directives = False
cdef bint has_keys = False
@@ -634,6 +617,23 @@ cdef class MappingNode(Node):
value._compose_on(key, target, path)
path.pop()
+ cdef Node _get(self, str key, object default, object default_constructor):
+ value = self.value.get(key, _sentinel)
+
+ if value is _sentinel:
+ if default is _sentinel:
+ provenance = self.get_provenance()
+ raise LoadError(LoadErrorReason.INVALID_DATA,
+ "{}: Dictionary did not contain expected key '{}'".format(provenance, key))
+
+ if default is None:
+ value = None
+ else:
+ value = default_constructor.__new__(
+ default_constructor, _SYNTHETIC_FILE_INDEX, 0, next_synthetic_counter(), default)
+
+ return value
+
cdef class SequenceNode(Node):
def __cinit__(self, int file_index, int line, int column, list value):