diff mbox series

[libgpiod] bindings: python: tests: replace LooseVersion with packaging.version.Version

Message ID 20241119144242.118764-1-brgl@bgdev.pl
State New
Headers show
Series [libgpiod] bindings: python: tests: replace LooseVersion with packaging.version.Version | expand

Commit Message

Bartosz Golaszewski Nov. 19, 2024, 2:42 p.m. UTC
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

Distutils are deprecated. Use the Version class from packaging.version
instead of LooseVersion from distutils.version.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 bindings/python/tests/__init__.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/bindings/python/tests/__init__.py b/bindings/python/tests/__init__.py
index a0f22ae..d6275bb 100644
--- a/bindings/python/tests/__init__.py
+++ b/bindings/python/tests/__init__.py
@@ -2,10 +2,11 @@ 
 # SPDX-FileCopyrightText: 2022 Bartosz Golaszewski <brgl@bgdev.pl>
 
 import os
-from distutils.version import LooseVersion
 
-required_kernel_version = LooseVersion("5.19.0")
-current_version = LooseVersion(os.uname().release.split("-")[0])
+from packaging.version import Version
+
+required_kernel_version = Version("5.19.0")
+current_version = Version(os.uname().release.split("-")[0])
 
 if current_version < required_kernel_version:
     raise NotImplementedError(