From 6e75972a1f0cadfc09721d853b2cb1135078627c Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 24 Nov 2022 16:54:34 +0000 Subject: bitbake: utils: Allow to_boolean to support int values Some variables may be set as: X = 1 as well the more usual X = "1" so add support to to_boolean to handle this case. (Bitbake rev: ef9c033b011e68bbfedf7ddf118633c14388aaaf) Signed-off-by: Richard Purdie --- bitbake/lib/bb/utils.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'bitbake/lib/bb/utils.py') diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 64a004d0d8..f4da356338 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py @@ -992,6 +992,9 @@ def to_boolean(string, default=None): if not string: return default + if isinstance(string, int): + return string != 0 + normalized = string.lower() if normalized in ("y", "yes", "1", "true"): return True -- cgit v1.2.3-54-g00ecf