[CMF-checkins] SVN: CMF/trunk/CMFCore/Skinnable.py Be very careful in __del__, the module level variable may have been Noned already.

Stefan H. Holek stefan at epy.co.at
Tue Apr 3 04:36:46 EDT 2007


Log message for revision 73987:
  Be very careful in __del__, the module level variable may have been Noned already.
  

Changed:
  U   CMF/trunk/CMFCore/Skinnable.py

-=-
Modified: CMF/trunk/CMFCore/Skinnable.py
===================================================================
--- CMF/trunk/CMFCore/Skinnable.py	2007-04-03 07:36:59 UTC (rev 73986)
+++ CMF/trunk/CMFCore/Skinnable.py	2007-04-03 08:36:44 UTC (rev 73987)
@@ -58,8 +58,10 @@
         self.tid = tid
     def __del__(self):
         tid = self.tid
-        if SKINDATA.has_key(tid):
-            del SKINDATA[tid]
+        # Be extra careful in __del__
+        if SKINDATA is not None:
+            if SKINDATA.has_key(tid):
+                del SKINDATA[tid]
 
 
 class SkinnableObjectManager(ObjectManager):



More information about the CMF-checkins mailing list