safe_eval: re-raise the same exception type when completing it.

bzr revid: vmt@openerp.com-20130226094446-7c2dw5c5eou0lg8r
This commit is contained in:
Vo Minh Thu
2013-02-26 10:44:46 +01:00
parent c62780673c
commit d43dba744c
+1 -1
View File
@@ -245,6 +245,6 @@ def safe_eval(expr, globals_dict=None, locals_dict=None, mode="eval", nocopy=Fal
except Exception, e:
import sys
exc_info = sys.exc_info()
raise ValueError, '"%s" while evaluating\n%r' % (ustr(e), expr), exc_info[2]
raise exc_info[0], '"%s" while evaluating\n%r' % (ustr(e), expr), exc_info[2]
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: