mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
bpo-35346: Cleanup platform.architecture() (GH-11130)
struct.calcsize('P') now always works.
This commit is contained in:
parent
3a8f4fef4a
commit
4aa917c5fe
1 changed files with 2 additions and 6 deletions
|
@ -651,12 +651,8 @@ def architecture(executable=sys.executable, bits='', linkage=''):
|
|||
# else is given as default.
|
||||
if not bits:
|
||||
import struct
|
||||
try:
|
||||
size = struct.calcsize('P')
|
||||
except struct.error:
|
||||
# Older installations can only query longs
|
||||
size = struct.calcsize('l')
|
||||
bits = str(size*8) + 'bit'
|
||||
size = struct.calcsize('P')
|
||||
bits = str(size * 8) + 'bit'
|
||||
|
||||
# Get data from the 'file' system command
|
||||
if executable:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue