[oe-commits] [openembedded-core] 07/19: oe.types.boolean: treat None as False

git at git.openembedded.org git at git.openembedded.org
Wed Jul 4 23:26:54 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 3048e9fa0df6b1edf79bd1723e0fc022c3332af1
Author: Binghua Guan <freebendy at gmail.com>
AuthorDate: Sat Jun 30 17:53:34 2018 +0800

    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 at gmail.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/lib/oe/types.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oe/types.py b/meta/lib/oe/types.py
index f778c1d..f401713 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
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list