summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael W. Hudson <mwh@python.net>2002-03-06 17:18:15 +0000
committerMichael W. Hudson <mwh@python.net>2002-03-06 17:18:15 +0000
commit02b28ec316114a646c7875a76edeb577c5c3581b (patch)
treee71cac5be0f1a47e3b59d1c41b60d865d49ee0cd
parent0e02530a798807db572968ba914ae3694d71eb91 (diff)
downloadcpython-git-02b28ec316114a646c7875a76edeb577c5c3581b.tar.gz
Test for
[ 526039 ] devious code can crash structseqs Bugfix candidate.
-rw-r--r--Lib/test/test_structseq.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_structseq.py b/Lib/test/test_structseq.py
index bbd7b7e289..c09e0691cd 100644
--- a/Lib/test/test_structseq.py
+++ b/Lib/test/test_structseq.py
@@ -13,4 +13,16 @@ for i in range(-len(t), len(t)):
for j in range(-len(t), len(t)):
vereq(t[i:j], astuple[i:j])
+# Devious code could crash structseqs' contructors
+class C:
+ def __getitem__(self, i):
+ raise IndexError
+ def __len__(self):
+ return 9
+
+try:
+ repr(time.struct_time(C()))
+except:
+ pass
+
# XXX more needed