From 5bc442c615030c525356386488c354b56c7d0bcc Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Fri, 18 Jul 2008 01:11:51 -0700 Subject: [PATCH] Fix bugs for rhs -> default and exception handling. --- Cython/CodeWriter.py | 4 ++-- Cython/Compiler/ExprNodes.py | 2 +- Cython/Compiler/Nodes.py | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cython/CodeWriter.py b/Cython/CodeWriter.py index 2d192856..7d995b08 100644 --- a/Cython/CodeWriter.py +++ b/Cython/CodeWriter.py @@ -70,9 +70,9 @@ class CodeWriter(TreeVisitor): if len(items) > 0: for item in items[:-1]: self.visit(item) - if output_rhs and item.rhs is not None: + if output_rhs and item.default is not None: self.put(u" = ") - self.visit(item.rhs) + self.visit(item.default) self.put(u", ") self.visit(items[-1]) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 3ace94e7..0644b9fc 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -1670,7 +1670,7 @@ class SimpleCallNode(CallNode): return func_type def exception_checks(self): - func_type = self.function.type + func_type = self.function_type() exc_val = func_type.exception_value exc_check = func_type.exception_check if exc_val is None and self.function.entry.visibility != 'extern': diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 711c6880..d237e5c6 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -358,6 +358,8 @@ class CNameDeclaratorNode(CDeclaratorNode): child_attrs = ['default'] + default = None + def analyse(self, base_type, env, nonempty = 0): if nonempty and self.name == '': # Must have mistaken the name for the type. -- 2.26.2