# HG changeset patch # User Dirkjan Ochtman # Date 2011-03-12 12:02:03 # Node ID 64a458707fd413709a9cae49a87c722795a6a641 # Parent e42d18538e1d28e68f0b2cbd50f661501e49aa07 setup.py: use StrictVersion instead of manual comparison diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -56,6 +56,7 @@ from distutils.spawn import spawn, find_ from distutils.ccompiler import new_compiler from distutils.errors import CCompilerError from distutils.sysconfig import get_python_inc +from distutils.version import StrictVersion scripts = ['hg'] if os.name == 'nt': @@ -379,7 +380,7 @@ if sys.platform == 'darwin' and os.path. version = runcmd(['/usr/bin/xcodebuild', '-version'], {}).splitlines()[0] # Also parse only first digit, because 3.2.1 can't be parsed nicely if (version.startswith('Xcode') and - int(version.split()[1].split('.')[0]) >= 4): + StrictVersion(version.split()[1]) >= StrictVersion('4.0')): os.environ['ARCHFLAGS'] = '-arch i386 -arch x86_64' setup(name='mercurial',