[Checkins] SVN: zodbupdate/trunk/src/zodbupdate/serialize.py Move iter fix to a meta class.
Sylvain Viollon
sylvain at infrae.com
Tue Jun 8 11:56:49 EDT 2010
Log message for revision 113292:
Move iter fix to a meta 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:31:22 UTC (rev 113291)
+++ zodbupdate/trunk/src/zodbupdate/serialize.py 2010-06-08 15:56:48 UTC (rev 113292)
@@ -36,11 +36,7 @@
raise StopIteration
-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).
- """
+class IterableClass(type):
def __iter__(self):
"""Define a empty iterator to fix unpickling of missing
@@ -49,6 +45,14 @@
"""
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