[Python-Dev] [Python-checkins] cpython: Issue #14779: Do not use get_config_var('SIZEOF_VOID_P') on OS X 64-/32-bit

"Martin v. Löwis" martin at v.loewis.de
Sun May 13 10:13:52 CEST 2012


> -        self.sizeof_void_p = get_config_var('SIZEOF_VOID_P')
> +        self.sizeof_void_p = get_config_var('SIZEOF_VOID_P') \
> +                                if sys.platform != 'darwin' else None
>           if not self.sizeof_void_p:
> -            self.sizeof_void_p = 8 if architecture()[0] == '64bit' else 4
> +            self.sizeof_void_p = 8 if sys.maxsize>  2**32 else 4
>

Why not unconditionally use sys.maxsize? I'd also hard-code that 
sys.maxsize ought to be either 2**31-1 or 2**63-1.

Regards,
Martin



More information about the Python-Dev mailing list