summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_struct.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py
index a4dc9ca..6e35db8 100644
--- a/Lib/test/test_struct.py
+++ b/Lib/test/test_struct.py
@@ -512,6 +512,10 @@ class StructTest(unittest.TestCase):
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 = 'Reykjavik rocks, eow!'
writable_buf = array.array('c', ' '*100)