Log message for revision 68285: Revert a change to a unit test that would assert that the results of hybrid path expressions where the alternate expression wasn't a PathExpr is not called. See http://www.zope.org/Collectors/Zope/538, http://svn.zope.org/?view=rev&rev=22855 and http://www.zope.org/Collectors/Zope3-dev/638.
Changed: U Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/Expressions.py U Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/tests/testExpressions.py -=- Modified: Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/Expressions.py =================================================================== --- Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/Expressions.py 2006-05-25 19:43:25 UTC (rev 68284) +++ Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/Expressions.py 2006-05-25 19:45:47 UTC (rev 68285) @@ -116,6 +116,8 @@ else: # On the last subexpression allow exceptions through. ob = self._subexprs[-1](econtext) + if self._hybrid: + return ob if self._name == 'nocall': return ob Modified: Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/tests/testExpressions.py =================================================================== --- Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/tests/testExpressions.py 2006-05-25 19:43:25 UTC (rev 68284) +++ Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/tests/testExpressions.py 2006-05-25 19:45:47 UTC (rev 68285) @@ -76,7 +76,7 @@ '''Test hybrid path expressions''' ec = self.ec assert ec.evaluate('x | python:1+1') == 2 - assert ec.evaluate('x | python:int') == 0 + assert ec.evaluate('x | python:int') == int assert ec.evaluate('x | string:x') == 'x' assert ec.evaluate('x | string:$one') == '1' assert ec.evaluate('x | not:exists:x') _______________________________________________ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins