code cleanup after last change
authorStefan Behnel <scoder@users.berlios.de>
Fri, 6 Jun 2008 16:22:23 +0000 (18:22 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Fri, 6 Jun 2008 16:22:23 +0000 (18:22 +0200)
Cython/Compiler/Nodes.py

index 0e5af11a88f509129523119ea7c2696883c189e8..1e5479fd62343b2b5d60b6b9a28ec93172d9b35d 100644 (file)
@@ -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: