Make this test work with older Python releases where struct has no 't' format character.

This commit is contained in:
Thomas Heller 2007-06-08 16:10:27 +00:00
parent b53940f238
commit 1b9e041812
1 changed files with 4 additions and 1 deletions

View File

@ -117,7 +117,10 @@ class NumberTestCase(unittest.TestCase):
def test_sizes(self):
for t in signed_types + unsigned_types + float_types + bool_types:
try:
size = struct.calcsize(t._type_)
except struct.error:
continue
# sizeof of the type...
self.failUnlessEqual(sizeof(t), size)
# and sizeof of an instance