[Checkins] SVN: zodbupdate/trunk/src/zodbupdate/serialize.py Actually, I want more to have __iter__ on the class.
Sylvain Viollon
sylvain at infrae.com
Tue Jun 8 12:02:03 EDT 2010
Log message for revision 113293:
Actually, I want more to have __iter__ on the class.
Changed:
U zodbupdate/trunk/src/zodbupdate/serialize.py
-=-
Modified: zodbupdate/trunk/src/zodbupdate/serialize.py
===================================================================
--- zodbupdate/trunk/src/zodbupdate/serialize.py 2010-06-08 15:56:48 UTC (rev 113292)
+++ zodbupdate/trunk/src/zodbupdate/serialize.py 2010-06-08 16:02:03 UTC (rev 113293)
@@ -36,23 +36,20 @@
raise StopIteration
-class IterableClass(type):
+class ZODBBroken(Broken):
+ """Extend ZODB Broken to work with broken objects that doesn't
+ have any __Broken_newargs__ sets (which happens if their __new__
+ method is not called).
+ """
- def __iter__(self):
+ @classmethod
+ def __iter__(cls):
"""Define a empty iterator to fix unpickling of missing
Interfaces that have been used to do alsoProvides on a another
pickled object.
"""
return NullIterator()
-
-class ZODBBroken(Broken):
- """Extend ZODB Broken to work with broken objects that doesn't
- have any __Broken_newargs__ sets (which happens if their __new__
- method is not called).
- """
- __metaclass__ = IterableClass
-
def __reduce__(self):
"""We pickle broken objects in hope of being able to fix them later.
"""
More information about the checkins
mailing list