mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 21:09:03 +02:00
oe.types.boolean: treat None as False
It is better to return False for None. E.g. checking an undefined variable returned d.getVar(). (From OE-Core rev: 3048e9fa0df6b1edf79bd1723e0fc022c3332af1) Signed-off-by: Binghua Guan <freebendy@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
ec9ad3648b
commit
0996eecb21
|
@ -103,8 +103,11 @@ def boolean(value):
|
|||
"""OpenEmbedded 'boolean' type
|
||||
|
||||
Valid values for true: 'yes', 'y', 'true', 't', '1'
|
||||
Valid values for false: 'no', 'n', 'false', 'f', '0'
|
||||
Valid values for false: 'no', 'n', 'false', 'f', '0', None
|
||||
"""
|
||||
if value is None:
|
||||
return False
|
||||
|
||||
if isinstance(value, bool):
|
||||
return value
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user