diff options
author | Phil Howard <phil@gadgetoid.com> | 2023-10-12 20:51:39 +0100 |
---|---|---|
committer | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2023-10-13 10:36:31 +0200 |
commit | 9f9671dbb68e612e4ea9e12921ba05c0f11955bd (patch) | |
tree | c9296fc12c5f5146a8f0ae02be4e1d518d3b39ed | |
parent | 85089d0e40ac01625ce55678bf28c99b1ceaa4a5 (diff) | |
download | libgpiod-9f9671dbb68e612e4ea9e12921ba05c0f11955bd.tar.gz |
bindings: python: simplify environ access
Use environ.get() in lieu of an explicit check for GPIOD_WITH_TESTS in
os.environ.
Returns None and evaluates as False if GPIOD_WITH_TESTS == "1" is
not specified.
Signed-off-by: Phil Howard <phil@gadgetoid.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-rw-r--r-- | bindings/python/setup.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bindings/python/setup.py b/bindings/python/setup.py index fd674aa8..df10e189 100644 --- a/bindings/python/setup.py +++ b/bindings/python/setup.py @@ -50,7 +50,7 @@ procname_ext = Extension( ) extensions = [gpiod_ext] -if "GPIOD_WITH_TESTS" in environ and environ["GPIOD_WITH_TESTS"] == "1": +if environ.get("GPIOD_WITH_TESTS") == "1": extensions.append(gpiosim_ext) extensions.append(procname_ext) |