diff options
author | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2019-07-22 07:59:55 +0100 |
---|---|---|
committer | Benjamin Schubert <contact@benschubert.me> | 2019-07-26 09:03:34 +0100 |
commit | fc8bc0fa0b7cd40ff9a1ab374e41713da3522c29 (patch) | |
tree | 0002360af042fac507710e36520232e75718c795 | |
parent | 5f28a5636414eaa10c99f7fd1aeb35ec15dc4200 (diff) | |
download | buildstream-fc8bc0fa0b7cd40ff9a1ab374e41713da3522c29.tar.gz |
foldme; exception arg ordering fixup
Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
-rw-r--r-- | src/buildstream/node.pyx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/buildstream/node.pyx b/src/buildstream/node.pyx index 7bbf2af6d..7e48a0343 100644 --- a/src/buildstream/node.pyx +++ b/src/buildstream/node.pyx @@ -362,9 +362,9 @@ cdef class ScalarNode(Node): except ValueError: provenance = self.get_provenance() path = provenance._toplevel._find(self)[-1] - raise LoadError(LoadErrorReason.INVALID_DATA, - "{}: Value of '{}' should be one of {}".format( - provenance, path, ", ".join(constraint))) + raise LoadError("{}: Value of '{}' should be one of {}".format( + provenance, path, ", ".join(constraint)), + LoadErrorReason.INVALID_DATA) cpdef int as_int(self) except *: """Get the value of the node as an integer. @@ -568,8 +568,8 @@ cdef class MappingNode(Node): 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)) + raise LoadError("{}: Dictionary did not contain expected key '{}'".format(provenance, key), + LoadErrorReason.INVALID_DATA) if default is None: return None @@ -578,9 +578,9 @@ cdef class MappingNode(Node): if type(value) is not ScalarNode: provenance = value.get_provenance() - raise LoadError(LoadErrorReason.INVALID_DATA, - "{}: Value of '{}' is not of the expected type 'scalar'" - .format(provenance, key)) + raise LoadError("{}: Value of '{}' is not of the expected type 'scalar'" + .format(provenance, key), + LoadErrorReason.INVALID_DATA) return (<ScalarNode> value).as_enum(constraint) |