We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 99c601a commit baa92a0Copy full SHA for baa92a0
bpython/simpleeval.py
@@ -160,6 +160,12 @@ def _convert(node):
160
obj = _convert(node.value)
161
index = _convert(node.slice.value)
162
return safe_getitem(obj, index)
163
+ elif sys.version_info[:2] >= (3, 9) and isinstance(node, ast.Subscript) and isinstance(
164
+ node.slice, ast.Constant
165
+ ):
166
+ obj = _convert(node.value)
167
+ index = node.slice.value
168
+ return safe_getitem(obj, index)
169
170
# this is a deviation from literal_eval: we allow attribute access
171
if isinstance(node, ast.Attribute):
0 commit comments