Message124331
OS X Mach-O universal executable files often contain multiple architectures including a combination of 32-bit and 64-bit archs, as with the newer OS X installer variants provided on python.org. In such cases, the platform.architecture() function always returns '64bit' as the bit architecture regardless of whether the interpreter is running in 32-bit or 64-bit mode. Thus, there is no documented way to reliably tell whether an interpreter is running in 32- or 64-bit in OS X. Instead of the platform module, one must resort to hacks like examining sys.maxsize (or sys.maxint) or checking type sizes from the struct module.
$ arch -x86_64 /usr/local/bin/python3.2 -c 'import sys,platform;
print(sys.maxsize,platform.architecture())'
9223372036854775807 ('64bit', '')
$ arch -i386 /usr/local/bin/python3.2 -c 'import sys,platform;
print(sys.maxsize,platform.architecture())'
2147483647 ('64bit', '') |
|
Date |
User |
Action |
Args |
2010-12-19 06:28:29 | ned.deily | set | recipients:
+ ned.deily, ronaldoussoren |
2010-12-19 06:28:29 | ned.deily | set | messageid: <1292740109.65.0.867895032728.issue10735@psf.upfronthosting.co.za> |
2010-12-19 06:28:26 | ned.deily | link | issue10735 messages |
2010-12-19 06:28:26 | ned.deily | create | |
|