summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGrzegorz Bokota <bokota+github@gmail.com>2020-12-04 11:48:08 +0100
committerGitHub <noreply@github.com>2020-12-04 12:48:08 +0200
commite6102e58153fa43089b920e3908eeb908170cf44 (patch)
tree22e46a73d411e72efca43246898714d998c1459e /src
parent39b6397ba944d82f1fe37d043382f97b78a919d6 (diff)
downloadwheel-git-e6102e58153fa43089b920e3908eeb908170cf44.tar.gz
Fixed error on Big Sur when deployment target = 11 (#386)
Fixes #385. Co-authored-by: FX Coudert <fxcoudert@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/wheel/macosx_libfile.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/wheel/macosx_libfile.py b/src/wheel/macosx_libfile.py
index 9141f26..f8ad3ca 100644
--- a/src/wheel/macosx_libfile.py
+++ b/src/wheel/macosx_libfile.py
@@ -350,15 +350,16 @@ def calculate_macosx_platform_tag(archive_root, platform_tag):
"""
prefix, base_version, suffix = platform_tag.split('-')
base_version = tuple([int(x) for x in base_version.split(".")])
- if len(base_version) >= 2:
- base_version = base_version[0:2]
-
+ base_version = base_version[:2]
+ if base_version[0] > 10:
+ base_version = (base_version[0], 0)
assert len(base_version) == 2
if "MACOSX_DEPLOYMENT_TARGET" in os.environ:
deploy_target = tuple([int(x) for x in os.environ[
"MACOSX_DEPLOYMENT_TARGET"].split(".")])
- if len(deploy_target) >= 2:
- deploy_target = deploy_target[0:2]
+ deploy_target = deploy_target[:2]
+ if deploy_target[0] > 10:
+ deploy_target = (deploy_target[0], 0)
if deploy_target < base_version:
sys.stderr.write(
"[WARNING] MACOSX_DEPLOYMENT_TARGET is set to a lower value ({}) than the "
@@ -378,7 +379,10 @@ def calculate_macosx_platform_tag(archive_root, platform_tag):
lib_path = os.path.join(dirpath, filename)
min_ver = extract_macosx_min_system_version(lib_path)
if min_ver is not None:
- versions_dict[lib_path] = min_ver[0:2]
+ min_ver = min_ver[0:2]
+ if min_ver[0] > 10:
+ min_ver = (min_ver[0], 0)
+ versions_dict[lib_path] = min_ver
if len(versions_dict) > 0:
base_version = max(base_version, max(versions_dict.values()))