aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
diff options
context:
space:
mode:
authorBinghua Guan <freebendy@gmail.com>2018-06-30 17:53:34 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-05 00:23:53 +0100
commit3048e9fa0df6b1edf79bd1723e0fc022c3332af1 (patch)
treede79d7885d6818c7f21e16d0a8401010dd4537bb /meta/lib/oe
parent32dded1bd2f6c5cf6437330830399b72f15096c4 (diff)
downloadopenembedded-core-contrib-3048e9fa0df6b1edf79bd1723e0fc022c3332af1.tar.gz
oe.types.boolean: treat None as False
It is better to return False for None. E.g. checking an undefined variable returned d.getVar(). Signed-off-by: Binghua Guan <freebendy@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r--meta/lib/oe/types.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/meta/lib/oe/types.py b/meta/lib/oe/types.py
index f778c1de68..f4017130df 100644
--- a/meta/lib/oe/types.py
+++ b/meta/lib/oe/types.py
@@ -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