[Erp5-report] r44532 jerome - /erp5/trunk/products/ERP5/ExplanationCache.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Mar 23 12:09:01 CET 2011


Author: jerome
Date: Wed Mar 23 12:09:01 2011
New Revision: 44532

URL: http://svn.erp5.org?rev=44532&view=rev
Log:
use isinstance to check type

Modified:
    erp5/trunk/products/ERP5/ExplanationCache.py

Modified: erp5/trunk/products/ERP5/ExplanationCache.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/ExplanationCache.py?rev=44532&r1=44531&r2=44532&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/ExplanationCache.py [utf8] (original)
+++ erp5/trunk/products/ERP5/ExplanationCache.py [utf8] Wed Mar 23 12:09:01 2011
@@ -27,7 +27,6 @@
 #
 ##############################################################################
 
-import types
 from zLOG import LOG
 from Products.CMFCore.utils import getToolByName
 from Products.ERP5Type.Cache import transactional_cached
@@ -117,7 +116,7 @@ class ExplanationCache:
       insert_movement = True
       for path_id in container_path:
         local_path_dict = local_path_dict.setdefault(path_id, {})
-        if type(local_path_dict) is not types.DictType:
+        if not isinstance(local_path_dict, dict):
           # A movement was already inserted
           insert_movement = False
           break
@@ -135,7 +134,7 @@ class ExplanationCache:
     result = []
     def browsePathDict(prefix, local_path_dict):
       for key, value in local_path_dict.items():
-        if type(value) is not types.DictType:
+        if not isinstance(value, dict):
           # We have a real root
           result.append('%s/%s' % (prefix, key))
           result.append('%s/%s/%%' % (prefix, key))



More information about the Erp5-report mailing list