From 859416e980dd6b4b96ad066e723709928c5afa81 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Sun, 4 Mar 2012 20:20:34 +0100 Subject: [PATCH] Fix sporadic failure in test_weakset --- Lib/_weakrefset.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Lib/_weakrefset.py b/Lib/_weakrefset.py index 91077c5b950..b8d804301ac 100644 --- a/Lib/_weakrefset.py +++ b/Lib/_weakrefset.py @@ -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)