Test for
[ 526039 ] devious code can crash structseqs Bugfix candidate.
This commit is contained in:
parent
0e02530a79
commit
02b28ec316
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue