Spaces:
Sleeping
Sleeping
Allowed nonlocal statements
Browse files
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 |
|