Skip to content

Commit

Permalink
Fix bug: should raise a SyntaxError when Slice found in ExtSlice
Browse files Browse the repository at this point in the history
  • Loading branch information
hsfzxjy committed Feb 7, 2021
1 parent 63d9475 commit 77d796f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lambdex/utils/ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ def _raise_slice_error():
if isinstance(slice_, ast.Index):
ret = slice_.value
elif isinstance(slice_, ast.ExtSlice):
for dim in slice_.dims:
if isinstance(dim, ast.Slice):
_raise_slice_error()
ret = slice_.dims
elif not isinstance(slice_, ast.Slice):
ret = slice_
Expand Down

0 comments on commit 77d796f

Please sign in to comment.