diff options
-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!' |