Commit 7f4768d6 authored by Jérome Perrin's avatar Jérome Perrin

Restricted: fix allow_full_write

parent 6884055d
...@@ -281,11 +281,11 @@ def allow_full_write(t): ...@@ -281,11 +281,11 @@ def allow_full_write(t):
# (closure) directly to allow write access (using __setattr__ and __delattr__) # (closure) directly to allow write access (using __setattr__ and __delattr__)
# to ndarray and pandas DataFrame below. # to ndarray and pandas DataFrame below.
from RestrictedPython.Guards import full_write_guard from RestrictedPython.Guards import full_write_guard
safetype = full_write_guard.func_closure[1].cell_contents.__self__ safetype = full_write_guard.func_closure[1].cell_contents
if isinstance(safetype, dict): # 3.6.0 if isinstance(safetype, set): # 5.1
safetype.update({t: True})
else: # 5.1
safetype.add(t) safetype.add(t)
else: # 3.6
safetype.__self__.update({t: True})
from AccessControl.ZopeGuards import _dict_white_list from AccessControl.ZopeGuards import _dict_white_list
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment