Commit 60428dd9 authored by Stefan Behnel's avatar Stefan Behnel

strip multiplication factor when recursively folding empty sequences

parent b72e2421
......@@ -3277,8 +3277,8 @@ class ConstantFolding(Visitor.VisitorTransform, SkipDeclarations):
if factor.constant_result != 1 and sequence_node.args:
if isinstance(factor.constant_result, (int, long)) and factor.constant_result <= 0:
del sequence_node.args[:]
else:
sequence_node.mult_factor = factor
factor = None
sequence_node.mult_factor = factor
return sequence_node
def visit_PrimaryCmpNode(self, node):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment