Message124333
The attached patches for py3k (3.2+) and 2.7 correct platform.architecture() to return the bit architecture ('32bit' or '64bit') of the running interpreter in the default case where executable = sys.executable. The linkage string will also contain information about the Mach-O executable including available bit- and processor-architectures as returned by the MacOS X file command.
An example of the most general results, using a 4-way build:
# ./configure --enable-universalsdk=/Developer/SDKs/MacOSX10.5.sdk --with-universal-archs=all MACOSX_DEPLOYMENT_TARGET=10.5
$ file ./python
./python: Mach-O universal binary with 4 architectures
./python (for architecture i386): Mach-O executable i386
./python (for architecture ppc7400): Mach-O executable ppc
./python (for architecture ppc64): Mach-O 64-bit executable ppc64
./python (for architecture x86_64): Mach-O 64-bit executable x86_64
$ arch -i386 ./python -c 'import platform;print(platform.architecture())'
('32bit', 'MachO 32bit 64bit i386 ppc ppc64 x86_64')
$ arch -x86_64 ./python -c 'import platform;print(platform.architecture())'
('64bit', 'MachO 32bit 64bit i386 ppc ppc64 x86_64')
$ arch -ppc ./python -c 'import platform;print(platform.architecture())'
('32bit', 'MachO 32bit 64bit i386 ppc ppc64 x86_64')
$ arch -i386 ./python -m platform
Darwin-10.5.0-i386-32bit-MachO_32bit_64bit_i386_ppc_ppc64_x86_64
$ arch -x86_64 ./python -m platform
Darwin-10.5.0-i386-64bit-MachO_32bit_64bit_i386_ppc_ppc64_x86_64
$ ./python -m platform --terse
Darwin-10.5.0 |
|
Date |
User |
Action |
Args |
2010-12-19 07:10:39 | ned.deily | set | recipients:
+ ned.deily, lemburg, ronaldoussoren |
2010-12-19 07:10:39 | ned.deily | set | messageid: <1292742639.88.0.864260049178.issue10735@psf.upfronthosting.co.za> |
2010-12-19 07:10:37 | ned.deily | link | issue10735 messages |
2010-12-19 07:10:37 | ned.deily | create | |
|