Commit 259d3487 authored by Evan Simpson's avatar Evan Simpson

Make string expressions exception-aware.

parent aa2e2e54
...@@ -89,7 +89,7 @@ Page Template-specific implementation of TALES, with handlers ...@@ -89,7 +89,7 @@ Page Template-specific implementation of TALES, with handlers
for Python expressions, string literals, and paths. for Python expressions, string literals, and paths.
""" """
__version__='$Revision: 1.16 $'[11:-2] __version__='$Revision: 1.17 $'[11:-2]
import re, sys import re, sys
from TALES import Engine, CompilerError, _valid_name, NAME_RE, \ from TALES import Engine, CompilerError, _valid_name, NAME_RE, \
...@@ -254,7 +254,10 @@ class StringExpr: ...@@ -254,7 +254,10 @@ class StringExpr:
def __call__(self, econtext): def __call__(self, econtext):
vvals = [] vvals = []
for var in self._vars: for var in self._vars:
vvals.append(var(econtext)) v = var(econtext)
if isinstance(v, Exception):
raise v
vvals.append(v)
return self._expr % tuple(vvals) return self._expr % tuple(vvals)
def __str__(self): def __str__(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment