guydav commited on
Commit
f68e463
1 Parent(s): 766f0e0

Allowed nonlocal statements

Browse files
Files changed (1) hide show
  1. restrictedpython_code_eval.py +4 -0
restrictedpython_code_eval.py CHANGED
@@ -168,6 +168,10 @@ class AllowAugmentedAssignAndUnderscoreVariableNamesRestrictingTransformer(Allow
168
  def __init__(self, *args, **kwargs):
169
  super().__init__(*args, **kwargs)
170
 
 
 
 
 
171
  def visit_Attribute(self, node):
172
  """Checks and mutates attribute access/assignment.
173
 
 
168
  def __init__(self, *args, **kwargs):
169
  super().__init__(*args, **kwargs)
170
 
171
+ def visit_Nonlocal(self, node):
172
+ # Allow nonlocal statements
173
+ return self.node_contents_visit(node)
174
+
175
  def visit_Attribute(self, node):
176
  """Checks and mutates attribute access/assignment.
177