[Zope-Checkins] CVS: Zope2 - DT_Let.py:1.6.72.1
fred@digicool.com
fred@digicool.com
Wed, 6 Jun 2001 12:58:05 -0400 (EDT)
Update of /cvs-repository/Zope2/lib/python/DocumentTemplate
In directory korak.digicool.com:/tmp/cvs-serv12522
Modified Files:
Tag: zope-2_3-branch
DT_Let.py
Log Message:
Use isinstance() and saved type objects consistently.
--- Updated File DT_Let.py in package Zope2 --
--- DT_Let.py 2000/07/05 15:28:12 1.6
+++ DT_Let.py 2001/06/06 16:58:04 1.6.72.1
@@ -115,7 +115,9 @@
from DT_Util import render_blocks, Eval, expr_globals, ParseError, regex, strip
from DT_Util import str # Probably needed due to hysterical pickles.
+StringType = type('')
+
class Let:
blockContinuations=()
name='let'
@@ -142,7 +144,7 @@
d={}; md._push(d)
try:
for name,expr in self.args:
- if type(expr) is type(''): d[name]=md[expr]
+ if isinstance(expr, StringType): d[name]=md[expr]
else: d[name]=expr(md)
return render_blocks(self.section, md)
finally: md._pop(1)