[Zope-Checkins] CVS: Packages/ZEO/zrpc - connection.py:

Tres Seaver tseaver at palladion.com
Sat May 28 20:42:17 EDT 2005

Update of /cvs-repository/Packages/ZEO/zrpc
In directory cvs.zope.org:/tmp/cvs-serv32028/lib/python/ZEO/zrpc

Modified Files:
      Tag: tseaver-hasattr_geddon-branch
Log Message:

  - Removed all uses of the 'hasattr' builtin from the core, where
    the object being tested derives (or might) from Persistent.
    XXX:  currently, this branch imports a 'safe_hasattr' from ZODB.utils,
    which adds a dependency on ZODB for some packages;  we probably
    need a better location, and perhas a C implementation?

=== Packages/ZEO/zrpc/connection.py => ===
--- Packages/ZEO/zrpc/connection.py:	Wed Feb  9 11:03:41 2005
+++ Packages/ZEO/zrpc/connection.py	Sat May 28 20:41:37 2005
@@ -26,6 +26,7 @@
 from ZEO.zrpc.trigger import trigger
 import zLOG
 from ZODB import POSException
+from ZODB.utils import safe_hasattr
 REPLY = ".reply" # message name used for replies
 ASYNC = 1
@@ -411,7 +412,7 @@
         # XXX Is this sufficient "security" for now?
         if name.startswith('_'):
             return None
-        return hasattr(self.obj, name)
+        return safe_hasattr(self.obj, name)
     def send_reply(self, msgid, ret):

More information about the Zope-Checkins mailing list