mirror of
https://github.com/grahampugh/macadmin-scripts.git
synced 2025-12-17 17:56:33 +00:00
use packaging.version.LegacyVersion
This commit is contained in:
parent
bd9205bde0
commit
f2e9a63872
@ -43,7 +43,7 @@ except ImportError:
|
|||||||
from xml.dom import minidom
|
from xml.dom import minidom
|
||||||
from xml.parsers.expat import ExpatError
|
from xml.parsers.expat import ExpatError
|
||||||
|
|
||||||
from pkg_resources import parse_version as Version
|
from packaging.version import LegacyVersion
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import xattr
|
import xattr
|
||||||
@ -704,7 +704,7 @@ def os_installer_product_info(
|
|||||||
def get_latest_version(current_item, latest_item):
|
def get_latest_version(current_item, latest_item):
|
||||||
"""Compares versions between two values and returns the latest (highest) value"""
|
"""Compares versions between two values and returns the latest (highest) value"""
|
||||||
try:
|
try:
|
||||||
if Version(current_item) > Version(latest_item):
|
if LegacyVersion(current_item) > LegacyVersion(latest_item):
|
||||||
return current_item
|
return current_item
|
||||||
else:
|
else:
|
||||||
return latest_item
|
return latest_item
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user