From: Simon Glass Date: Tue, 29 Jan 2019 20:58:56 -0700 Subject: [U-Boot] [PATCH 01/40] binman: Don't generate an error in 'text' entry constructor In-Reply-To: <20190130035935.235565-1-sjg@chromium.org> References: <20190130035935.235565-1-sjg@chromium.org> Message-ID: <20190130035935.235565-2-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de It is not good practice to raise an exception in a constructor. In this case the 'text' entry may not actually be used, if -i is used to filter out the images that get built. Move the exception to where the data is actually used. Signed-off-by: Simon Glass --- tools/binman/etype/text.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/binman/etype/text.py b/tools/binman/etype/text.py index 6e99819487..c4aa510a87 100644 --- a/tools/binman/etype/text.py +++ b/tools/binman/etype/text.py @@ -51,10 +51,10 @@ class Entry_text(Entry): self.text_label, = self.GetEntryArgsOrProps( [EntryArg('text-label', str)]) self.value, = self.GetEntryArgsOrProps([EntryArg(self.text_label, str)]) + + def ObtainContents(self): if not self.value: self.Raise("No value provided for text label '%s'" % self.text_label) - - def ObtainContents(self): self.SetContents(self.value) return True -- 2.20.1.495.gaa96b0ce6b-goog