[OE-core] [PATCH 1/1] bbclass: bb.fatal() clean up

Chris Larson clarson at kergoth.com
Thu May 9 02:23:33 UTC 2013


On Wed, May 8, 2013 at 7:14 PM, Robert Yang <liezhi.yang at windriver.com>wrote:

> On 05/08/2013 08:03 PM, Mike Looijmans wrote:
>
>> On 05/08/2013 11:06 AM, Robert Yang wrote:
>>
>>> The bb.fatal() is defined as:
>>>
>>> def fatal(*args):
>>>      logger.critical(''.join(args))
>>>      sys.exit(1)
>>>
>>> So anything after bb.fatal() in the same code block doesn't have any
>>> effect, e.g.:
>>>
>>>      bb.fatal("%s_%s: %s" % (var, pkg, e))
>>>      raise e
>>>
>>> The "raise e" should be removed.
>>>
>>
>> Just some random thoughts that occurred to me when I read this:
>>
>>
> Hi Mike, thanks for your comments, but the "raise sys.exit(1)" doesn't
> raise
> anything, e.g.:
>
> import sys
>
> def fatal():
>         sys.exit(1)
>
> try:
>         raise fatal()
> except Exception as e:
>         raise e
>
> I think that the "raise fatal()" equals to "fatal()" here.


He didn't say raise sys.exit(1), he said sys.exit(1) is equivalent to raise
SystemExit(1), which it is.
-- 
Christopher Larson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20130508/64d07269/attachment-0001.html>


More information about the Openembedded-core mailing list