Skip to content

Commit 2bfd36e

Browse files
author
Andy C
committed
[fix] Type error
1 parent 435acd1 commit 2bfd36e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

osh/sh_expr_eval.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -700,9 +700,9 @@ def Eval(self, node):
700700
with tagswitch(left) as case:
701701
if case(value_e.BashArray):
702702
array_val = cast(value.BashArray, UP_left)
703-
index = mops.BigTruncate(
703+
small_i = mops.BigTruncate(
704704
self.EvalToBigInt(node.right))
705-
s = word_eval.GetArrayItem(array_val.strs, index)
705+
s = word_eval.GetArrayItem(array_val.strs, small_i)
706706

707707
elif case(value_e.BashAssoc):
708708
left = cast(value.BashAssoc, UP_left)
@@ -718,8 +718,7 @@ def Eval(self, node):
718718
index = self.EvalToBigInt(node.right)
719719
# s[0] evaluates to s
720720
# s[1] evaluates to Undef
721-
s = left.s if mops.Equal(index,
722-
mops.ZERO) else None
721+
s = left.s if mops.Equal(index, mops.ZERO) else None
723722

724723
elif case(value_e.Undef):
725724
if self.exec_opts.strict_arith():

0 commit comments

Comments
 (0)