diff options
author | Thomas Heller <theller@ctypes.org> | 2007-06-08 16:10:27 (GMT) |
---|---|---|
committer | Thomas Heller <theller@ctypes.org> | 2007-06-08 16:10:27 (GMT) |
commit | 1b9e041812293fc37d13b42010e3a714dc4e5a14 (patch) | |
tree | 69cbc14d473cd5c4164e11252362dc6a6132bff6 | |
parent | b53940f238c55c8b715301e6b5902ef2d15cfefa (diff) | |
download | cpython-1b9e041812293fc37d13b42010e3a714dc4e5a14.zip cpython-1b9e041812293fc37d13b42010e3a714dc4e5a14.tar.gz cpython-1b9e041812293fc37d13b42010e3a714dc4e5a14.tar.bz2 |
Make this test work with older Python releases where struct has no 't' format character.
-rw-r--r-- | Lib/ctypes/test/test_numbers.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/ctypes/test/test_numbers.py b/Lib/ctypes/test/test_numbers.py index ead3605..ff2da86 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 |