mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-03 08:04:07 +01:00
ChannelStats: Forbid large numbers for factorial().
This commit is contained in:
parent
66782d47d8
commit
035c38a4f1
@ -295,6 +295,12 @@ class ChannelStats(callbacks.Plugin):
|
||||
_calc_match_forbidden_chars = re.compile('[_[\]]')
|
||||
_env = {'__builtins__': types.ModuleType('__builtins__')}
|
||||
_env.update(math.__dict__)
|
||||
def _factorial(x):
|
||||
if x<=10000:
|
||||
return math.factorial(x)
|
||||
else:
|
||||
raise Exception('factorial argument too large')
|
||||
_env['factorial'] = _factorial
|
||||
@internationalizeDocstring
|
||||
def rank(self, irc, msg, args, channel, expr):
|
||||
"""[<channel>] <stat expression>
|
||||
|
Loading…
Reference in New Issue
Block a user