diff options
author | Victor Stinner <vstinner@redhat.com> | 2018-12-14 12:14:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-14 12:14:10 (GMT) |
commit | 4aa917c5feaec07a6f6db87b34185ab6180e20ee (patch) | |
tree | 85b940e6197a21e4c007181534cf02e26b2c1d10 /Lib/platform.py | |
parent | 3a8f4fef4a4dd0e4a800545468eef9542e126181 (diff) | |
download | cpython-4aa917c5feaec07a6f6db87b34185ab6180e20ee.zip cpython-4aa917c5feaec07a6f6db87b34185ab6180e20ee.tar.gz cpython-4aa917c5feaec07a6f6db87b34185ab6180e20ee.tar.bz2 |
bpo-35346: Cleanup platform.architecture() (GH-11130)
struct.calcsize('P') now always works.
Diffstat (limited to 'Lib/platform.py')
-rwxr-xr-x | Lib/platform.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Lib/platform.py b/Lib/platform.py index ab0cf25..0fe841c 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -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: |