[Zope-Checkins] CVS: Zope3/lib/python/Zope/Security - Proxy.py:1.1.2.3

Jeremy Hylton jeremy@zope.com
Wed, 17 Apr 2002 18:46:46 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/Security
In directory cvs.zope.org:/tmp/cvs-serv25745

Modified Files:
      Tag: SecurityProxy-branch
	Proxy.py 
Log Message:
Fix the stand-in proxy


=== Zope3/lib/python/Zope/Security/Proxy.py 1.1.2.2 => 1.1.2.3 ===
 
     def __call__(self, *args, **kw):
-        return getattr(self.object, '__call__')(*args, **kw)
+        try:
+            return getattr(self.object, '__call__')(*args, **kw)
+        except TypeError, msg:
+            msg = str(msg)
+            if (msg.find("descriptor") != -1
+                and msg.find("requires") != -1):
+                f = getattr(self.object, '__call__')
+                return f(self.object, *args, **kw)
+            raise
 
     def __getattr__(self, attr):
         return Proxy(getattr(self.object, attr), None)