From 255cec154a8e65c1005bce7d113398d009d1d6f7 Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Wed, 27 Mar 2013 17:04:20 +0100 Subject: [PATCH] [IMP] report: let the exceptions bubble up when using eval(). bzr revid: vmt@openerp.com-20130327160420-pxw83283xcro1h52 --- openerp/report/render/rml2pdf/utils.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/openerp/report/render/rml2pdf/utils.py b/openerp/report/render/rml2pdf/utils.py index 273d5815609..75923e64081 100644 --- a/openerp/report/render/rml2pdf/utils.py +++ b/openerp/report/render/rml2pdf/utils.py @@ -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):