1
0
mirror of https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git synced 2026-10-25 12:39:18 +03:00
Files
libgpiod/bindings/python/tests/__init__.py
Bartosz Golaszewski 05658dc1bc bindings: python: fix the distutils import
The presence of _distutils in setuptools is an implementation detail. If
we want anything from the distutils package, we should import it directly.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2023-10-24 10:16:50 +02:00

18 lines
513 B
Python

# SPDX-License-Identifier: LGPL-2.1-or-later
# SPDX-FileCopyrightText: 2022 Bartosz Golaszewski <brgl@bgdev.pl>
import os
import unittest
from distutils.version import LooseVersion
required_kernel_version = LooseVersion("5.19.0")
current_version = LooseVersion(os.uname().release.split("-")[0])
if current_version < required_kernel_version:
raise NotImplementedError(
"linux kernel version must be at least {} - got {}".format(
required_kernel_version, current_version
)
)