Skip to content

Commit

Permalink
Restrict the tests to the __builtins__ allowed by RestrictedPython.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz committed Feb 8, 2019
1 parent 748e9f5 commit 409de3e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ def _eval(compile_func):
def _eval(source, glb=None):
code = _compile(compile_func, source)
if glb is None:
glb = {}
glb = {
'__builtins__': RestrictedPython.Guards.safe_builtins.copy()}
return eval(code, glb)
return _eval

Expand Down

0 comments on commit 409de3e

Please sign in to comment.