summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_buffer.py
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2012-05-12 21:11:51 (GMT)
committerStefan Krah <skrah@bytereef.org>2012-05-12 21:11:51 (GMT)
commit094d0e002c8e21aa5872b37953d7e135df1d3e9c (patch)
tree8b431b7f00bcb35a4ddfe5f699e7d7dd33912470 /Lib/test/test_buffer.py
parent04b2e69e67f0d7a6283150a0f634b94d9ba148bd (diff)
downloadcpython-094d0e002c8e21aa5872b37953d7e135df1d3e9c.zip
cpython-094d0e002c8e21aa5872b37953d7e135df1d3e9c.tar.gz
cpython-094d0e002c8e21aa5872b37953d7e135df1d3e9c.tar.bz2
Issue #14779: Do not use get_config_var('SIZEOF_VOID_P') on OS X 64-/32-bit
universal: it returns a meaningless result. Use sys.maxsize instead of platform.architecture as a fallback. Patch by Ned Deily.
Diffstat (limited to 'Lib/test/test_buffer.py')
-rw-r--r--Lib/test/test_buffer.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_buffer.py b/Lib/test/test_buffer.py
index e0006f2..258c850 100644
--- a/Lib/test/test_buffer.py
+++ b/Lib/test/test_buffer.py
@@ -16,7 +16,6 @@ from test import support
from itertools import permutations, product
from random import randrange, sample, choice
from sysconfig import get_config_var
-from platform import architecture
import warnings
import sys, array, io
from decimal import Decimal
@@ -748,9 +747,10 @@ if SHORT_TEST:
class TestBufferProtocol(unittest.TestCase):
def setUp(self):
- self.sizeof_void_p = get_config_var('SIZEOF_VOID_P')
+ self.sizeof_void_p = get_config_var('SIZEOF_VOID_P') \
+ if sys.platform != 'darwin' else None
if not self.sizeof_void_p:
- self.sizeof_void_p = 8 if architecture()[0] == '64bit' else 4
+ self.sizeof_void_p = 8 if sys.maxsize > 2**32 else 4
def verify(self, result, obj=-1,
itemsize={1}, fmt=-1, readonly={1},