Skip to content

Commit 883c54e

Browse files
DinoVfacebook-github-bot
authored andcommitted
Handle more errors
Summary: We can get a couple of more exception types out of the constant folding then we're currently handling. Reviewed By: jbower-fb Differential Revision: D81802594 fbshipit-source-id: f533efbb8440c2a36491cbd2cc0fc674dbd0b41a
1 parent 746c95d commit 883c54e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cinderx/PythonLib/cinderx/compiler/flow_graph_optimizer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ def optimize_binary_op(
10241024

10251025
try:
10261026
res = op(lhs, rhs)
1027-
except (ArithmeticError, TypeError):
1027+
except (ArithmeticError, TypeError, ValueError, IndexError):
10281028
return
10291029

10301030
consts[0].set_to_nop_no_loc()
@@ -1044,7 +1044,7 @@ def optimize_one_unary(
10441044

10451045
try:
10461046
res = op(consts[0].oparg)
1047-
except (ArithmeticError, TypeError):
1047+
except (ArithmeticError, TypeError, ValueError, IndexError):
10481048
return
10491049

10501050
consts[0].set_to_nop_no_loc()

0 commit comments

Comments
 (0)