mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-30 14:59:34 +01:00
Made it so if IndexError is raised, the data structure isn't modified in __delitem__
This commit is contained in:
parent
0f018d0221
commit
76539b36ef
@ -228,6 +228,10 @@ class queue(object):
|
|||||||
if len(range) != len(value):
|
if len(range) != len(value):
|
||||||
raise ValueError, 'seq must be the same length as slice.'
|
raise ValueError, 'seq must be the same length as slice.'
|
||||||
else:
|
else:
|
||||||
|
for i in range:
|
||||||
|
(m, idx) = divmod(oidx, len(self))
|
||||||
|
if m and m != -1:
|
||||||
|
raise IndexError, oidx
|
||||||
for (i, x) in zip(range, value):
|
for (i, x) in zip(range, value):
|
||||||
self[i] = x
|
self[i] = x
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user