From 162592d28619cc58b6c7b8ccf7728cedad9be7e5 Mon Sep 17 00:00:00 2001 From: leonsbane Date: Mon, 20 May 2024 10:40:03 +0000 Subject: [PATCH] Update utils.py to use 'packaging' instead of deprecated 'distutils' PEP 632 deprecates the distutils module. The module is marked as deprecated in Python 3.10 and 3.11, and was eventually removed in Python 3.12. The PEP advises to replace the usage of 'distutils.version' with 'packaging.version', with the 'LooseVersion' functionality being provided through the 'parse' method. This replacement advice is detailed in the PEP under 'Migration Advice' --- jellyfin_kodi/helper/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jellyfin_kodi/helper/utils.py b/jellyfin_kodi/helper/utils.py index 60cec1cd..99f38eaf 100644 --- a/jellyfin_kodi/helper/utils.py +++ b/jellyfin_kodi/helper/utils.py @@ -10,7 +10,7 @@ import sys import re import unicodedata from uuid import uuid4 -from distutils.version import LooseVersion +from packaging.version import parse from dateutil import tz, parser from six import text_type, string_types, iteritems, ensure_text, ensure_binary @@ -112,8 +112,8 @@ def compare_version(a, b): 1 a is larger 0 equal ''' - a = LooseVersion(a) - b = LooseVersion(b) + a = parse(a) + b = parse(b) if a < b: return -1