summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_struct.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_struct.py')
-rw-r--r--Lib/test/test_struct.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py
index 16c2b9e..816cedb 100644
--- a/Lib/test/test_struct.py
+++ b/Lib/test/test_struct.py
@@ -317,9 +317,8 @@ class StructTest(unittest.TestCase):
randrange)
with check_warnings(("integer argument expected, "
"got non-integer", DeprecationWarning)):
- self.assertRaises((TypeError, struct.error),
- struct.pack, self.format,
- 3+42j)
+ with self.assertRaises((TypeError, struct.error)):
+ struct.pack(self.format, 3+42j)
# an attempt to convert a non-integer (with an
# implicit conversion via __int__) should succeed,