Skip to content

Commit

Permalink
Merge a46eb5b into aada1f4
Browse files Browse the repository at this point in the history
  • Loading branch information
shughes-uk committed Jan 9, 2020
2 parents aada1f4 + a46eb5b commit 99a3b38
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion simpleeval.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,15 @@
# people not be stupid. Allowing these functions opens up all sorts of holes - if any of
# their functionality is required, then please wrap them up in a safe container. And think
# very hard about it first. And don't say I didn't warn you.
if 'help' in __builtins__:
DISALLOW_FUNCTIONS = {
type, isinstance, eval, getattr, setattr, help, repr, compile, open
}
else:
DISALLOW_FUNCTIONS = {
type, isinstance, eval, getattr, setattr, repr, compile, open
}

DISALLOW_FUNCTIONS = {type, isinstance, eval, getattr, setattr, help, repr, compile, open}

if PYTHON3:
exec('DISALLOW_FUNCTIONS.add(exec)') # exec is not a function in Python2...
Expand Down

0 comments on commit 99a3b38

Please sign in to comment.