From f0d37d225f30ce25cb3c406bc59683442a2582a1 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Sat, 13 Mar 2010 01:36:54 -0800 Subject: [PATCH] Exception corner case. --- Cython/Compiler/Nodes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 7355fc31..2f2ee886 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -4497,7 +4497,8 @@ class ExceptClauseNode(Node): else: code.putln("/*except:*/ {") - if not getattr(self.body, 'stats', True): + if not getattr(self.body, 'stats', True) and + self.excinfo_target is None and self.target is None): # most simple case: no exception variable, empty body (pass) # => reset the exception state, done code.putln("PyErr_Restore(0,0,0);") -- 2.26.2