From: Thomas Heller Date: Fri, 8 Jun 2007 16:10:27 +0000 (+0000) Subject: Make this test work with older Python releases where struct has no 't' format character. X-Git-Tag: v2.6a1~1647 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1b9e041812293fc37d13b42010e3a714dc4e5a14;p=python Make this test work with older Python releases where struct has no 't' format character. --- diff --git a/Lib/ctypes/test/test_numbers.py b/Lib/ctypes/test/test_numbers.py index ead360588f..ff2da86ea0 100644 --- a/Lib/ctypes/test/test_numbers.py +++ b/Lib/ctypes/test/test_numbers.py @@ -117,7 +117,10 @@ class NumberTestCase(unittest.TestCase): def test_sizes(self): for t in signed_types + unsigned_types + float_types + bool_types: - size = struct.calcsize(t._type_) + try: + size = struct.calcsize(t._type_) + except struct.error: + continue # sizeof of the type... self.failUnlessEqual(sizeof(t), size) # and sizeof of an instance