projects
/
platform
/
upstream
/
python-cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
729310a
)
discard else clause from try-except statements that do not terminate normally
author
Stefan Behnel
<stefan_ml@behnel.de>
Sat, 14 Dec 2013 19:39:37 +0000
(20:39 +0100)
committer
Stefan Behnel
<stefan_ml@behnel.de>
Sat, 14 Dec 2013 19:39:37 +0000
(20:39 +0100)
Cython/Compiler/ParseTreeTransforms.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/ParseTreeTransforms.py
b/Cython/Compiler/ParseTreeTransforms.py
index
39d669e
..
cc74b33
100644
(file)
--- a/
Cython/Compiler/ParseTreeTransforms.py
+++ b/
Cython/Compiler/ParseTreeTransforms.py
@@
-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):