summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_structseq.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_structseq.py')
-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 bbd7b7e..c09e069 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