diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py index ecf38ba28b0..23ec29afddd 100644 --- a/Lib/test/test_struct.py +++ b/Lib/test/test_struct.py @@ -234,7 +234,8 @@ def test_one(self, x, pack=struct.pack, b'\x01' + got) else: # x is out of range -- verify pack realizes that. - self.assertRaises(struct.error, pack, format, x) + self.assertRaises((OverflowError, struct.error), pack, + format, x) def run(self): from random import randrange