bpo-35346: Cleanup platform.architecture() (GH-11130)

struct.calcsize('P') now always works.
This commit is contained in:
Victor Stinner 2018-12-14 13:14:10 +01:00 committed by GitHub
parent 3a8f4fef4a
commit 4aa917c5fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 6 deletions

View File

@ -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: