From 366d82545efff8f671e2bc86d3e0c0aa789543bb Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Wed, 30 Nov 2022 13:42:30 +0100 Subject: [PATCH] bindings: python: fix the GPIOD_WITH_TESTS build flag Currently in order to disable test the variable needs to be explicitly set to GPIOD_WITH_TESTS= in the environment or setup.py will crash. Assume tests should not be built if the variable is not set at all. Signed-off-by: Bartosz Golaszewski --- bindings/python/setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bindings/python/setup.py b/bindings/python/setup.py index 2a8481c..c90d7d7 100644 --- a/bindings/python/setup.py +++ b/bindings/python/setup.py @@ -28,8 +28,7 @@ gpiosim_ext = Extension( ) extensions = [gpiod_ext] -with_tests = bool(environ["GPIOD_WITH_TESTS"]) -if with_tests: +if "GPIOD_WITH_TESTS" in environ and environ["GPIOD_WITH_TESTS"] == "1": extensions.append(gpiosim_ext) with open("gpiod/version.py", "r") as fd: -- 2.30.2