[Zope-Checkins] SVN: Zope/trunk/lib/python/AccessControl/ImplPython.py Use isinstance, like the C implementation.

Florent Guillaume fg at nuxeo.com
Thu Jun 1 12:30:16 EDT 2006


Log message for revision 68449:
  Use isinstance, like the C implementation.
  

Changed:
  U   Zope/trunk/lib/python/AccessControl/ImplPython.py

-=-
Modified: Zope/trunk/lib/python/AccessControl/ImplPython.py
===================================================================
--- Zope/trunk/lib/python/AccessControl/ImplPython.py	2006-06-01 16:29:40 UTC (rev 68448)
+++ Zope/trunk/lib/python/AccessControl/ImplPython.py	2006-06-01 16:30:15 UTC (rev 68449)
@@ -317,9 +317,8 @@
                             None)
 
             if p is not None:
-                tp = p.__class__
-                if tp is not int and tp is not bool:
-                    if tp is dict:
+                if not isinstance(p, int): # catches bool too
+                    if isinstance(p, dict):
                         if isinstance(name, basestring):
                             p = p.get(name)
                         else:



More information about the Zope-Checkins mailing list