Exception corner case.
authorRobert Bradshaw <robertwb@math.washington.edu>
Sat, 13 Mar 2010 09:36:54 +0000 (01:36 -0800)
committerRobert Bradshaw <robertwb@math.washington.edu>
Sat, 13 Mar 2010 09:36:54 +0000 (01:36 -0800)
Cython/Compiler/Nodes.py

index 7355fc313b503fa48903ef0300e476e96b88ec09..2f2ee886a69c40fd4509bf5ae04ebd5c1aaaf78d 100644 (file)
@@ -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);")