Commit 8755e2ff authored by Stefan Behnel's avatar Stefan Behnel

code cleanup after last change

parent a8023e5e
...@@ -956,26 +956,19 @@ class FuncDefNode(StatNode, BlockNode): ...@@ -956,26 +956,19 @@ class FuncDefNode(StatNode, BlockNode):
exc_check = self.caller_will_check_exceptions() exc_check = self.caller_will_check_exceptions()
if err_val is not None or exc_check: if err_val is not None or exc_check:
code.putln('__Pyx_AddTraceback("%s");' % self.entry.qualified_name) 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: else:
code.putln( code.putln(
'__Pyx_WriteUnraisable("%s");' % '__Pyx_WriteUnraisable("%s");' %
self.entry.qualified_name) self.entry.qualified_name)
env.use_utility_code(unraisable_exception_utility_code) env.use_utility_code(unraisable_exception_utility_code)
#if not self.return_type.is_void:
default_retval = self.return_type.default_value default_retval = self.return_type.default_value
if default_retval: if err_val is None and default_retval:
err_val = default_retval
if err_val is not None:
code.putln( code.putln(
"%s = %s;" % ( "%s = %s;" % (
Naming.retval_cname, Naming.retval_cname,
default_retval)) err_val))
#self.return_type.default_value))
# ----- Return cleanup # ----- Return cleanup
code.put_label(code.return_label) code.put_label(code.return_label)
if not Options.init_local_none: if not Options.init_local_none:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment