summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_userdict.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_userdict.py b/Lib/test/test_userdict.py
index e61238f..a7541c8 100644
--- a/Lib/test/test_userdict.py
+++ b/Lib/test/test_userdict.py
@@ -155,8 +155,12 @@ class SeqDict(DictMixin):
raise KeyError
return self.valuelist[i]
def __setitem__(self, key, value):
- self.keylist.append(key)
- self.valuelist.append(value)
+ try:
+ i = self.keylist.index(key)
+ self.valuelist[i] = value
+ except ValueError:
+ self.keylist.append(key)
+ self.valuelist.append(value)
def __delitem__(self, key):
try:
i = self.keylist.index(key)