From: Ronald Oussoren Date: Thu, 24 Dec 2009 13:06:39 +0000 (+0000) Subject: On OSX the output of "uname -m" always reflects the 32-bit architecture X-Git-Tag: v2.7a2~118 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=728cc6110faa6e43baad195303e14fe6f97aea02;p=python On OSX the output of "uname -m" always reflects the 32-bit architecture for the machine ("i386" or "ppc"), even if the executable is 64-bit. This patchs ensures that the distutils platform architecture represents the architecture for the executable when running a 64-bit only executable on OSX. --- diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py index b8e4952fee..f4bb0633c5 100644 --- a/Lib/distutils/util.py +++ b/Lib/distutils/util.py @@ -165,11 +165,21 @@ def get_platform(): raise ValueError( "Don't know machine value for archs=%r"%(archs,)) + elif machine == 'i386': + # On OSX the machine type returned by uname is always the + # 32-bit variant, even if the executable architecture is + # the 64-bit variant + if sys.maxint >= 2**32: + machine = 'x86_64' elif machine in ('PowerPC', 'Power_Macintosh'): # Pick a sane name for the PPC architecture. machine = 'ppc' + # See 'i386' case + if sys.maxint >= 2**32: + machine = 'ppc64' + return "%s-%s-%s" % (osname, release, machine)