diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-06-21 00:14:31 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-06-21 00:16:49 +0100 |
commit | 147f5a665fe5073027d92e4acac631f15f08f79f (patch) | |
tree | 0636ae8c79a1ac53e099c97afaa087a7b1a27c52 | |
parent | b503b1fe9a71f70726c92f46a71fc49615256fce (diff) | |
download | openembedded-core-147f5a665fe5073027d92e4acac631f15f08f79f.tar.gz openembedded-core-147f5a665fe5073027d92e4acac631f15f08f79f.tar.bz2 openembedded-core-147f5a665fe5073027d92e4acac631f15f08f79f.zip |
oe/types: Allow boolean to accept an existing boolean
Exception: TypeError: boolean accepts a string, not '<class 'bool'>
is a bit annoying if you pass in True/False. Tweak the function
to make it forgive that situation.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oe/types.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/meta/lib/oe/types.py b/meta/lib/oe/types.py index 4ae58acfac..f778c1de68 100644 --- a/meta/lib/oe/types.py +++ b/meta/lib/oe/types.py @@ -105,6 +105,8 @@ def boolean(value): Valid values for true: 'yes', 'y', 'true', 't', '1' Valid values for false: 'no', 'n', 'false', 'f', '0' """ + if isinstance(value, bool): + return value if not isinstance(value, str): raise TypeError("boolean accepts a string, not '%s'" % type(value)) |