Skip to content

Commit

Permalink
Backwards compatibility for kernel utils module
Browse files Browse the repository at this point in the history
This is a fix of kerne utils compatibility issue with setuptools=>70
which has been introduced in df6b1da.

Reference: avocado-framework#5988
Signed-off-by: Jan Richter <[email protected]>
  • Loading branch information
richtja committed Aug 12, 2024
1 parent d223935 commit 58738b6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions avocado/utils/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
import shutil
import tempfile

from packaging.version import parse
try:
import packaging
except ImportError:
from pkg_resources import packaging

from avocado.utils import archive, asset, build, distro, process

Expand Down Expand Up @@ -207,6 +210,6 @@ def check_version(version):
:type version: string
:param version: version to be compared with current kernel version
"""
os_version = parse(os.uname()[2])
version = parse(version)
os_version = packaging.version.parse(os.uname()[2])
version = packaging.version.parse(version)
assert os_version > version, "Old kernel"

0 comments on commit 58738b6

Please sign in to comment.