Fix sporadic failure in test_weakset

This commit is contained in:
Antoine Pitrou 2012-03-04 20:20:34 +01:00
parent 1cb2e04238
commit 859416e980
1 changed files with 2 additions and 5 deletions

View File

@ -116,11 +116,8 @@ class WeakSet(object):
def update(self, other):
if self._pending_removals:
self._commit_removals()
if isinstance(other, self.__class__):
self.data.update(other.data)
else:
for element in other:
self.add(element)
for element in other:
self.add(element)
def __ior__(self, other):
self.update(other)