workaround for Mac OS X Big Sur, Python 3.9 install fail

sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')

returns <str> '11.1' in Python 2.7 and <int> 11 in Python 3.9 causing exception: builtins.TypeError: expected string or bytes-like object
pull/24998/head
Jorjun 4 years ago
parent a7f3009fc0
commit eba18503cc
  1. 3
      setup.py

@ -354,8 +354,9 @@ if "linux" in sys.platform or "darwin" in sys.platform:
# By default, Python3 distutils enforces compatibility of
# c plugins (.so files) with the OSX version Python was built with.
# We need OSX 10.10, the oldest which supports C++ thread_local.
# Python 3.9: Mac OS Big Sur sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') returns int (11)
if 'darwin' in sys.platform:
mac_target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
mac_target = str(sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET'))
if mac_target and (pkg_resources.parse_version(mac_target) <
pkg_resources.parse_version('10.10.0')):
os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.10'

Loading…
Cancel
Save