[ 526039 ] devious code can crash structseqs

Bugfix candidate.
This commit is contained in:
Michael W. Hudson 2002-03-06 17:18:15 +00:00
parent 0e02530a79
commit 02b28ec316
1 changed files with 12 additions and 0 deletions

View File

@ -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