changeset: 76885:8f22e5be18c8 user: Stefan Krah date: Sat May 12 23:11:51 2012 +0200 files: Lib/test/test_buffer.py description: 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. diff -r 3b368c4ad7c5 -r 8f22e5be18c8 Lib/test/test_buffer.py --- a/Lib/test/test_buffer.py Sat May 12 19:02:47 2012 +0200 +++ b/Lib/test/test_buffer.py Sat May 12 23:11:51 2012 +0200 @@ -16,7 +16,6 @@ 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 @@ 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},

AltStyle によって変換されたページ (->オリジナル) /