From 7593edb6fc7e1702c8aa6e6e0cba1480d411a486 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Mon, 7 May 2012 17:52:02 +0200 Subject: [PATCH] Math: Allow 'factorial()' in icalc. Signed-off-by: James McCoy --- plugins/Math/plugin.py | 5 +++-- plugins/Math/test.py | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/Math/plugin.py b/plugins/Math/plugin.py index c34891461..01c9261fc 100644 --- a/plugins/Math/plugin.py +++ b/plugins/Math/plugin.py @@ -103,7 +103,8 @@ class Math(callbacks.Plugin): _mathEnv['abs'] = abs _mathEnv['max'] = max _mathEnv['min'] = min - _mathEnv.pop('factorial') + _mathSafeEnv = dict([(x,y) for x,y in _mathEnv.items() + if x not in ['factorial']]) _mathRe = re.compile(r'((?:(?