Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Still clear errors that occur in constant folding
  • Loading branch information
ncoghlan committed Nov 7, 2020
commit f8e52c0e002a893d0a0cce005f68c0f0ca009a4d
6 changes: 2 additions & 4 deletions Python/ast_opt.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,8 @@ fold_binop(expr_ty node, PyArena *arena, _PyASTOptimizeState *state)
// operators are added without being handled here
}

// If no new value was calculated, there's nothing to do
if (newval == NULL) {
return 1;
}
// Even if no new value was calculated, make_const may still
// need to clear an error (e.g. for division by zero)

return make_const(node, newval, arena);
}
Expand Down