mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-10-13 12:22:04 +00:00
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'
This commit is contained in:
parent
eb035f83f9
commit
162592d286
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue