[Checkins] SVN: z3c.ptcompat/trunk/ Remove stale templates from migration registry.
Malthe Borch
mborch at gmail.com
Mon Apr 19 11:13:05 EDT 2010
Log message for revision 111102:
Remove stale templates from migration registry.
Changed:
U z3c.ptcompat/trunk/CHANGES.txt
U z3c.ptcompat/trunk/src/z3c/ptcompat/config.py
-=-
Modified: z3c.ptcompat/trunk/CHANGES.txt
===================================================================
--- z3c.ptcompat/trunk/CHANGES.txt 2010-04-19 15:07:13 UTC (rev 111101)
+++ z3c.ptcompat/trunk/CHANGES.txt 2010-04-19 15:13:05 UTC (rev 111102)
@@ -3,6 +3,10 @@
In next release...
+- Remove broken templates from registry during engine migration. In
+ some testing situation, stale templates would be tracked in the
+ regitry.
+
- Existing template instances are now migrated to the right engine
when using the ``enable`` and ``disable`` methods. [malthe]
Modified: z3c.ptcompat/trunk/src/z3c/ptcompat/config.py
===================================================================
--- z3c.ptcompat/trunk/src/z3c/ptcompat/config.py 2010-04-19 15:07:13 UTC (rev 111101)
+++ z3c.ptcompat/trunk/src/z3c/ptcompat/config.py 2010-04-19 15:13:05 UTC (rev 111102)
@@ -37,4 +37,8 @@
new_cls = getattr(z3c.ptcompat, cls.__name__)
inst.__class__ = new_cls
inst.__dict__.clear()
- inst.__init__(*args, **kwargs)
+ try:
+ inst.__init__(*args, **kwargs)
+ except (OSError, ValueError):
+ # remove broken templates from registry
+ REGISTRY.pop(inst, None)
More information about the checkins
mailing list