[Zodb-checkins] CVS: Packages/ZEO/zrpc - connection.py:1.49.4.5.2.1

Tres Seaver tseaver at palladion.com
Sat May 28 20:42:22 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
	connection.py 
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 1.49.4.5 => 1.49.4.5.2.1 ===
--- Packages/ZEO/zrpc/connection.py:1.49.4.5	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):
         try:



More information about the Zodb-checkins mailing list