TOOLS/macos-sdk-version: use packaging instead of distutils for version

Python 3.10 deprecated disutils and then removed it in 3.12. The macos
sdk check uses the version compare from there, so it needs to be
replaced with something else. So instead use the API from the packaging
module which is also widely available and a fit replacement.

Fixes #12762.
This commit is contained in:
Dudemanguy 2023-10-27 11:56:00 -05:00
parent 8bbcc87fee
commit 65806ac4d1
1 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ import re
import os
import string
import sys
from distutils.version import StrictVersion
from packaging import version
from shutil import which
from subprocess import check_output
@ -56,7 +56,7 @@ def find_macos_sdk():
sdk_version = '10.10.0'
# pick the higher version, always pick sdk over build if newer
if StrictVersion(build_version) > StrictVersion(sdk_version):
if version.parse(build_version) > version.parse(sdk_version):
return sdk,build_version
else:
return sdk,sdk_version