#3694: fix an "XXX undetected error" leak in struct.
diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py
index 2bc92f3..3d5e028 100644
--- a/Lib/test/test_struct.py
+++ b/Lib/test/test_struct.py
@@ -524,6 +524,10 @@
self.assertRaises(struct.error, s.pack_into, small_buf, 0, test_string)
self.assertRaises(struct.error, s.pack_into, small_buf, 2, test_string)
+ # Test bogus offset (issue 3694)
+ sb = small_buf
+ self.assertRaises(TypeError, struct.pack_into, b'1', sb, None)
+
def test_pack_into_fn(self):
test_string = b'Reykjavik rocks, eow!'
writable_buf = array.array('b', b' '*100)