[Python-checkins] r77026 - python/trunk/Lib/distutils/util.py

Tarek Ziadé ziade.tarek at gmail.com
Thu Dec 24 14:14:48 CET 2009


Can you add a test for this change in test_util if possible?

I am trying to keep the test coverage high for all new changes.

Thanks !

On Thu, Dec 24, 2009 at 2:06 PM, ronald.oussoren
<python-checkins at python.org> wrote:
> Author: ronald.oussoren
> Date: Thu Dec 24 14:06:39 2009
> New Revision: 77026
>
> Log:
> 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.
>
>
> Modified:
>   python/trunk/Lib/distutils/util.py
>
> Modified: python/trunk/Lib/distutils/util.py
> ==============================================================================
> --- python/trunk/Lib/distutils/util.py  (original)
> +++ python/trunk/Lib/distutils/util.py  Thu Dec 24 14:06:39 2009
> @@ -165,11 +165,21 @@
>                     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)
>
>
> _______________________________________________
> Python-checkins mailing list
> Python-checkins at python.org
> http://mail.python.org/mailman/listinfo/python-checkins
>



-- 
Tarek Ziadé | http://ziade.org


More information about the Python-checkins mailing list