From a8023e5eef686a7327396bd781fe1ad614cd737c Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 6 Jun 2008 17:11:57 +0200 Subject: [PATCH] fix return value setting for 'except *' functions --- Cython/Compiler/Nodes.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 58831036..0e5af11a 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -956,6 +956,8 @@ class FuncDefNode(StatNode, BlockNode): exc_check = self.caller_will_check_exceptions() if err_val is not None or exc_check: code.putln('__Pyx_AddTraceback("%s");' % self.entry.qualified_name) + if err_val is None and self.return_type.default_value: + err_val = self.return_type.default_value if err_val is not None: code.putln( "%s = %s;" % ( -- 2.26.2