From: Bartosz Golaszewski Date: Wed, 30 Nov 2022 12:42:30 +0000 (+0100) Subject: bindings: python: fix the GPIOD_WITH_TESTS build flag X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=366d82545efff8f671e2bc86d3e0c0aa789543bb;p=qemu-gpiodev%2Flibgpiod.git 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 --- 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: