From: Stefan Behnel Date: Fri, 6 Jun 2008 15:11:57 +0000 (+0200) Subject: fix return value setting for 'except *' functions X-Git-Tag: 0.9.8rc1~11^2~10^2~6^2~7 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a8023e5eef686a7327396bd781fe1ad614cd737c;p=cython.git fix return value setting for 'except *' functions --- 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;" % (