Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/RestrictedPython/Eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@ def prepUnrestrictedCode(self):
used = set()
for node in ast.walk(exp_node):
if isinstance(node, ast.Name):
if isinstance(node.ctx, ast.Load):
used.add(node.id)
# As we are in 'eval' mode here, no other contexts
# should be possible, but who knows:
assert isinstance(node.ctx, ast.Load)
used.add(node.id)

self.used = tuple(used)

Expand Down