From: Simon Glass Date: Fri, 26 Apr 2019 03:58:33 +0000 (-0600) Subject: binman: Don't generate an error in 'text' entry constructor X-Git-Tag: v2019.07-rc2~14^2~48 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5203258c6e149ab865e337c00437a909abf3b5b4;p=platform%2Fkernel%2Fu-boot.git binman: Don't generate an error in 'text' entry constructor 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 Reviewed-by: Bin Meng --- diff --git a/tools/binman/etype/text.py b/tools/binman/etype/text.py index 6e99819..c4aa510 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