[FIX]:FormatLang is not support any python aggregate function like abs(),reduce() etc as an argument.
bzr revid: apa@tinyerp.com-20100810110942-zb47ggw15qa1c0os
This commit is contained in:
parent
1a4ef0313f
commit
c49797ad30
|
@ -35,6 +35,7 @@ condition/math builtins.
|
|||
from opcode import HAVE_ARGUMENT, opmap, opname
|
||||
from types import CodeType
|
||||
import logging
|
||||
import os
|
||||
|
||||
__all__ = ['test_expr', 'literal_eval', 'safe_eval', 'const_eval', 'ext_eval' ]
|
||||
|
||||
|
@ -262,6 +263,9 @@ def safe_eval(expr, globals_dict=None, locals_dict=None, mode="eval", nocopy=Fal
|
|||
}
|
||||
)
|
||||
|
||||
builtions = globals_dict.get('__builtins__')
|
||||
builtions.update(os.__builtins__)
|
||||
|
||||
return eval(test_expr(expr,_SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
Loading…
Reference in New Issue