From: Robert Bradshaw Date: Sat, 13 Mar 2010 09:36:54 +0000 (-0800) Subject: Exception corner case. X-Git-Tag: 0.13.beta0~311 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f0d37d225f30ce25cb3c406bc59683442a2582a1;p=cython.git Exception corner case. --- 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);")