[IMP] report: let the exceptions bubble up when using eval().

bzr revid: vmt@openerp.com-20130327160420-pxw83283xcro1h52
This commit is contained in:
Vo Minh Thu 2013-03-27 17:04:20 +01:00
parent 461973b4c9
commit 255cec154a
1 changed files with 5 additions and 8 deletions

View File

@ -131,14 +131,11 @@ def _process_text(self, txt):
to_translate = tools.ustr(sps.pop(0))
result += tools.ustr(self.localcontext.get('translate', lambda x:x)(to_translate))
if sps:
try:
txt = None
expr = sps.pop(0)
txt = eval(expr, self.localcontext)
if txt and isinstance(txt, basestring):
txt = tools.ustr(txt)
except Exception:
pass
txt = None
expr = sps.pop(0)
txt = eval(expr, self.localcontext)
if txt and isinstance(txt, basestring):
txt = tools.ustr(txt)
if isinstance(txt, basestring):
result += txt
elif txt and (txt is not None) and (txt is not False):