Skip to content

Commit

Permalink
TOOLS/macos-sdk-version: use packaging instead of distutils for version
Browse files Browse the repository at this point in the history
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 mpv-player#12762.
  • Loading branch information
Dudemanguy committed Oct 27, 2023
1 parent 8bbcc87 commit 65806ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions TOOLS/macos-sdk-version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import os
import string
import sys
from distutils.version import StrictVersion
from packaging import version
from shutil import which
from subprocess import check_output

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 65806ac

Please sign in to comment.