From 8755e2ff61194d588dcadc9aa8f247b4c49305d6 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 6 Jun 2008 18:22:23 +0200 Subject: [PATCH] code cleanup after last change --- Cython/Compiler/Nodes.py | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 0e5af11a..1e5479fd 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -956,26 +956,19 @@ 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;" % ( - Naming.retval_cname, - err_val)) else: code.putln( '__Pyx_WriteUnraisable("%s");' % self.entry.qualified_name) env.use_utility_code(unraisable_exception_utility_code) - #if not self.return_type.is_void: - default_retval = self.return_type.default_value - if default_retval: - code.putln( - "%s = %s;" % ( - Naming.retval_cname, - default_retval)) - #self.return_type.default_value)) + default_retval = self.return_type.default_value + if err_val is None and default_retval: + err_val = default_retval + if err_val is not None: + code.putln( + "%s = %s;" % ( + Naming.retval_cname, + err_val)) # ----- Return cleanup code.put_label(code.return_label) if not Options.init_local_none: -- 2.26.2