]> granicus.if.org Git - python/commitdiff
Make this test work with older Python releases where struct has no 't' format character.
authorThomas Heller <theller@ctypes.org>
Fri, 8 Jun 2007 16:10:27 +0000 (16:10 +0000)
committerThomas Heller <theller@ctypes.org>
Fri, 8 Jun 2007 16:10:27 +0000 (16:10 +0000)
Lib/ctypes/test/test_numbers.py

index ead360588fbb579322b5fc5cfdd1adec68f665e0..ff2da86ea0259640e932f331df73eda0642e7311 100644 (file)
@@ -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