]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Port 2.7 fix for sporadic failure in test_weakset.
authorAntoine Pitrou <solipsis@pitrou.net>
Sun, 4 Mar 2012 19:20:34 +0000 (20:20 +0100)
committerAntoine Pitrou <solipsis@pitrou.net>
Sun, 4 Mar 2012 19:20:34 +0000 (20:20 +0100)
Lib/_weakrefset.py

index f34aa864bc2ac58a4f1a2daba472057a524af3f4..c2717e72281406ee06993e567dc61a02df834893 100644 (file)
@@ -114,11 +114,8 @@ class WeakSet:
     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)