From 87a1d4f6637480ea34a14ef5f498b420cbe242d4 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Tue, 10 Sep 2019 10:39:12 +0200 Subject: [PATCH] bindings: python: tests: fix checking the kernel version Kernel release candidate version strings seem to not be working correctly with python's version.parse() function. Split the string retrieved with os.uname().release using '-' as delimiter and pass only the first part - 'major.minor.release' - to version.parse(). Signed-off-by: Bartosz Golaszewski --- bindings/python/tests/gpiod_py_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/python/tests/gpiod_py_test.py b/bindings/python/tests/gpiod_py_test.py index 9cc15af..8533bae 100755 --- a/bindings/python/tests/gpiod_py_test.py +++ b/bindings/python/tests/gpiod_py_test.py @@ -68,7 +68,7 @@ class EventThread(threading.Thread): self.join() def check_kernel(major, minor, release): - current = os.uname().release + current = os.uname().release.split('-')[0] required = '{}.{}.{}'.format(major, minor, release) if version.parse(current) < version.parse(required): raise NotImplementedError( -- 2.30.2