[Zope3-checkins] CVS: Zope3/lib/python/Zope/PageTemplate - Expressions.py:1.3

Viktorija Zaksiene ryzaja@codeworks.lt
Thu, 7 Nov 2002 09:27:37 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/PageTemplate
In directory cvs.zope.org:/tmp/cvs-serv14266

Modified Files:
	Expressions.py 
Log Message:
Fixed path expressions of the form 'foo/?bar' where the value of bar is a Unicode string.

=== Zope3/lib/python/Zope/PageTemplate/Expressions.py 1.2 => 1.3 ===
--- Zope3/lib/python/Zope/PageTemplate/Expressions.py:1.2	Mon Jun 10 19:29:29 2002
+++ Zope3/lib/python/Zope/PageTemplate/Expressions.py	Thu Nov  7 09:27:37 2002
@@ -18,6 +18,7 @@
 __metaclass__ = type # All classes are new style when run with Python 2.2+
 
 import re, sys
+from types import StringTypes
 
 from TALES import ExpressionEngine, CompilerError, RegistrationError
 from TALES import _valid_name, _parse_expr, NAME_RE, Undefined
@@ -59,14 +60,14 @@
         dp.reverse()
 
     def _eval(self, econtext,
-              list=list, isinstance=isinstance, StringType=type('')):
+              list=list, isinstance=isinstance):
         vars = econtext.vars
         path = self._path
         if self._dp:
             path = list(path) # Copy!
             for i, varname in self._dp:
                 val = vars[varname]
-                if isinstance(val, StringType):
+                if isinstance(val, StringTypes):
                     path[i] = val
                 else:
                     # If the value isn't a string, assume it's a sequence