[Zope-Checkins] CVS: Zope/lib/python/Shared/DC/ZRDB - DA.py:1.107
R. David Murray
bitz@bitdance.com
Mon, 16 Dec 2002 18:00:37 -0500
Update of /cvs-repository/Zope/lib/python/Shared/DC/ZRDB
In directory cvs.zope.org:/tmp/cvs-serv21821/lib/python/Shared/DC/ZRDB
Modified Files:
DA.py
Log Message:
Fix for Collector 322: generate a more informative error message if
someone tries to use 'client' as an argument to a zsql method.
=== Zope/lib/python/Shared/DC/ZRDB/DA.py 1.106 => 1.107 ===
--- Zope/lib/python/Shared/DC/ZRDB/DA.py:1.106 Fri Nov 22 21:07:06 2002
+++ Zope/lib/python/Shared/DC/ZRDB/DA.py Mon Dec 16 18:00:36 2002
@@ -426,7 +426,14 @@
security=getSecurityManager()
security.addContext(self)
- try: query=apply(self.template, (p,), argdata)
+ try:
+ try: query=apply(self.template, (p,), argdata)
+ except TypeError, msg:
+ msg = str(msg)
+ if find(msg,'client'):
+ raise NameError("'client' may not be used as an " +
+ "argument name in this context")
+ else: raise
finally: security.removeContext(self)
if src__: return query