bpo-35346: Cleanup platform.architecture() (GH-11130)
struct.calcsize('P') now always works.
This commit is contained in:
parent
3a8f4fef4a
commit
4aa917c5fe
|
@ -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'
|
||||
bits = str(size * 8) + 'bit'
|
||||
|
||||
# Get data from the 'file' system command
|
||||
if executable:
|
||||
|
|
Loading…
Reference in New Issue