Commit c41dccb4 authored by Stefan Behnel's avatar Stefan Behnel

discard else clause from try-except statements that do not terminate normally

parent 729310a8
......@@ -2160,6 +2160,12 @@ class RemoveUnreachableCode(CythonTransform):
node.is_terminator = True
return node
def visit_TryExceptStatNode(self, node):
self.visitchildren(node)
if node.body.is_terminator:
node.else_clause = None
return node
class YieldNodeCollector(TreeVisitor):
......
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