Skip to content

Commit

Permalink
Fix exception catching
Browse files Browse the repository at this point in the history
  • Loading branch information
rihi committed Jul 3, 2024
1 parent 24faaef commit 88ee97f
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ def apply(self, operation: Operation) -> list[tuple[Expression, Expression]]:

# We don't need to catch UnsupportedOperationType, because check that operation is in _COLLAPSIBLE_OPERATIONS
# We don't need to catch UnsupportedMismatchedSizes, because '_collect_constants' only returns constants of the same type
# We don't need to catch UnsupportedValueType, because '_collect_constants' only returns constants with supported value types
try:
folded_constant = reduce(lambda c0, c1: constant_fold(operation.operation, [c0, c1], operation.type), rest, first)
except UnsupportedValueType:
return []
except IncompatibleOperandCount as e:
raise MalformedData() from e

Expand Down

0 comments on commit 88ee97f

Please sign in to comment.