| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -160,6 +160,12 @@ def _convert(node): | |||
| 160 | 160 | obj = _convert(node.value) | |
| 161 | 161 | index = _convert(node.slice.value) | |
| 162 | 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) | ||
| 163 | 169 | ||
| 164 | 170 | # this is a deviation from literal_eval: we allow attribute access | |
| 165 | 171 | if isinstance(node, ast.Attribute): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments