[Python-checkins] cpython (merge 3.2 -> default): Port 2.7 fix for sporadic failure in test_weakset.

antoine.pitrou python-checkins at python.org
Sun Mar 4 21:04:09 CET 2012


http://hg.python.org/cpython/rev/2843f32a3a34
changeset:   75399:2843f32a3a34
parent:      75391:f7a9a10ae0c0
parent:      75398:5a2bc0d574f6
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Sun Mar 04 20:55:35 2012 +0100
summary:
  Port 2.7 fix for sporadic failure in test_weakset.

files:
  Lib/_weakrefset.py |  7 ++-----
  1 files changed, 2 insertions(+), 5 deletions(-)


diff --git a/Lib/_weakrefset.py b/Lib/_weakrefset.py
--- a/Lib/_weakrefset.py
+++ b/Lib/_weakrefset.py
@@ -114,11 +114,8 @@
     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)

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list