Skip to content

Commit

Permalink
Add unpack_sequence to globals.
Browse files Browse the repository at this point in the history
  • Loading branch information
sallner committed May 4, 2017
1 parent 3ec8f4d commit 56a7143
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/AccessControl/ZopeGuards.py
Expand Up @@ -24,6 +24,7 @@
from RestrictedPython.Eval import RestrictionCapableEval
from RestrictedPython.Guards import full_write_guard
from RestrictedPython.Guards import guarded_iter_unpack_sequence
from RestrictedPython.Guards import guarded_unpack_sequence
from RestrictedPython.Guards import safe_builtins
from RestrictedPython.Utilities import utility_builtins
from zExceptions import Unauthorized
Expand Down Expand Up @@ -671,6 +672,7 @@ def protected_inplacevar(op, var, expr):
'_getitem_': guarded_getitem,
'_getiter_': guarded_iter,
'_iter_unpack_sequence_': guarded_iter_unpack_sequence,
'_unpack_sequence_': guarded_unpack_sequence,
'_print_': RestrictedPython.PrintCollector,
'_write_': full_write_guard,
'_inplacevar_': protected_inplacevar,
Expand Down
10 changes: 10 additions & 0 deletions src/AccessControl/tests/actual_python.py
Expand Up @@ -247,3 +247,13 @@ def f13():


f13()


def f14():
(a, (b, c)) = (1, (3, (4, 5)))
assert a == 1
assert b == 3
assert c == (4, 5)


f14()

0 comments on commit 56a7143

Please sign in to comment.