[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/interface/__init__.py Sniff, sometimes we have proxied interface. :(

Stephan Richter srichter at cosmos.phy.tufts.edu
Thu Oct 14 03:54:06 EDT 2004


Log message for revision 28146:
  Sniff, sometimes we have proxied interface. :(
  

Changed:
  U   Zope3/trunk/src/zope/app/interface/__init__.py

-=-
Modified: Zope3/trunk/src/zope/app/interface/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/interface/__init__.py	2004-10-14 00:16:18 UTC (rev 28145)
+++ Zope3/trunk/src/zope/app/interface/__init__.py	2004-10-14 07:54:04 UTC (rev 28146)
@@ -22,8 +22,10 @@
 from persistent import Persistent
 from persistent.dict import PersistentDict
 from zodbcode.patch import registerWrapper, Wrapper
+
 from zope.interface.interface import InterfaceClass
 from zope.interface import Interface
+from zope.security.proxy import removeSecurityProxy
 
 class PersistentInterfaceClass(Persistent, InterfaceClass):
 
@@ -119,7 +121,10 @@
     'I4'
 
     """
-    object_iro = providedBy(object).__iro__
+    # Remove the security proxy, so that we can introspect the type of the
+    # object's interfaces.
+    naked = removeSecurityProxy(object)
+    object_iro = providedBy(naked).__iro__
     for iface in object_iro:
         if interface.providedBy(iface):
             return iface



More information about the Zope3-Checkins mailing list