diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-07-09 13:28:42 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-07-09 13:28:42 (GMT) |
commit | a04a32d5868ceea902b3219c00da958deee1c7de (patch) | |
tree | b0ac91a0823d76d14124e8e17407509a41cff9c8 /Lib/test/test_struct.py | |
parent | c2f583a7f9cb4be57e5f856d6713a7e46a6e334e (diff) | |
download | cpython-a04a32d5868ceea902b3219c00da958deee1c7de.zip cpython-a04a32d5868ceea902b3219c00da958deee1c7de.tar.gz cpython-a04a32d5868ceea902b3219c00da958deee1c7de.tar.bz2 |
allow more exceptions
Diffstat (limited to 'Lib/test/test_struct.py')
-rw-r--r-- | Lib/test/test_struct.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py index 23ec29a..96efa73 100644 --- a/Lib/test/test_struct.py +++ b/Lib/test/test_struct.py @@ -47,8 +47,8 @@ class StructTest(unittest.TestCase): self.assertRaises(struct.error, struct.pack, 'iii', 3) self.assertRaises(struct.error, struct.pack, 'i', 3, 3, 3) - self.assertRaises(struct.error, struct.pack, 'i', 'foo') - self.assertRaises(struct.error, struct.pack, 'P', 'foo') + self.assertRaises((TypeError, struct.error), struct.pack, 'i', 'foo') + self.assertRaises((TypeError, struct.error), struct.pack, 'P', 'foo') self.assertRaises(struct.error, struct.unpack, 'd', b'flap') s = struct.pack('ii', 1, 2) self.assertRaises(struct.error, struct.unpack, 'iii', s) @@ -446,7 +446,7 @@ class StructTest(unittest.TestCase): # Test bogus offset (issue 3694) sb = small_buf - self.assertRaises(TypeError, struct.pack_into, b'', sb, None) + self.assertRaises((TypeError, struct.error), struct.pack_into, b'', sb, None) def test_pack_into_fn(self): test_string = b'Reykjavik rocks, eow!' |