Skip to content

Commit

Permalink
prevent distutils not found exception
Browse files Browse the repository at this point in the history
  • Loading branch information
szabolcsdombi committed Oct 14, 2023
1 parent 544daa2 commit 215a638
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@

if target == 'darwin':
import os
from distutils.sysconfig import get_config_var
from distutils.version import LooseVersion
if 'MACOSX_DEPLOYMENT_TARGET' not in os.environ:
current_system = LooseVersion(platform.mac_ver()[0])
python_target = LooseVersion(get_config_var('MACOSX_DEPLOYMENT_TARGET'))
if python_target < '10.9' and current_system >= '10.9':
os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.9'

if sys.version_info[:2] < (3, 12):
from distutils.sysconfig import get_config_var
from distutils.version import LooseVersion
if 'MACOSX_DEPLOYMENT_TARGET' not in os.environ:
current_system = LooseVersion(platform.mac_ver()[0])
python_target = LooseVersion(get_config_var('MACOSX_DEPLOYMENT_TARGET'))
if python_target < '10.9' and current_system >= '10.9':
os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.9'

wgl = Extension(
name='glcontext.wgl',
Expand Down

0 comments on commit 215a638

Please sign in to comment.