From: Georg Brandl Date: Fri, 13 Feb 2009 11:03:59 +0000 (+0000) Subject: #3694: add test for fix committed in r66693. X-Git-Tag: v2.7a1~2037 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0638a08a4b7998a40755f3f141c63f637b1ab144;p=thirdparty%2FPython%2Fcpython.git #3694: add test for fix committed in r66693. --- diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py index a4dc9ca66758..6e35db85dccd 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)