[ZPT] CVS: Zope27/lib/python/Products/PageTemplates - PythonExpr.py:1.7.18.1

Fred L. Drake, Jr. fdrake@acm.org
Tue, 17 Sep 2002 13:23:21 -0400


Update of /cvs-repository/Zope27/lib/python/Products/PageTemplates
In directory cvs.zope.org:/tmp/cvs-serv25398

Modified Files:
      Tag: Zope-2_7-development-branch
	PythonExpr.py 
Log Message:
_bind_used_names():  Inline the logic from SafeMapping.has_get(),
    which was only used from this one location.


=== Zope27/lib/python/Products/PageTemplates/PythonExpr.py 1.7 => 1.7.18.1 ===
--- Zope27/lib/python/Products/PageTemplates/PythonExpr.py:1.7	Fri Apr 19 10:16:09 2002
+++ Zope27/lib/python/Products/PageTemplates/PythonExpr.py	Tue Sep 17 13:23:20 2002
@@ -43,18 +43,19 @@
             if vname[0] not in '$_':
                 vnames.append(vname)
 
-    def _bind_used_names(self, econtext):
+    def _bind_used_names(self, econtext, _marker=[]):
         # Bind template variables
         names = {}
         vars = econtext.vars
         getType = econtext._engine.getTypes().get
         for vname in self._f_varnames:
-            has, val = vars.has_get(vname)
-            if not has:
+            val = vars.get(vname, _marker)
+            if val is _marker:
                 has = val = getType(vname)
                 if has:
                     val = ExprTypeProxy(vname, val, econtext)
-            if has:
+                    names[vname] = val
+            else:
                 names[vname] = val
         return names