From: Bartosz Golaszewski Date: Tue, 10 Sep 2019 08:39:12 +0000 (+0200) Subject: bindings: python: tests: fix checking the kernel version X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=87a1d4f6637480ea34a14ef5f498b420cbe242d4;p=qemu-gpiodev%2Flibgpiod.git 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 --- 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(