From 2f2fa55cc02db5d8d1cc7358cb93bbe9cadbf12a Mon Sep 17 00:00:00 2001 From: Dag Sverre Seljebotn Date: Tue, 7 Jul 2009 10:07:22 +0200 Subject: [PATCH] Partial fix for #307, see ticket --- Cython/Compiler/ExprNodes.py | 4 ++++ tests/errors/callingnonexisting_T307.pyx | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 tests/errors/callingnonexisting_T307.pyx diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index cb59255e..1922db25 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -2578,6 +2578,9 @@ class GeneralCallNode(CallNode): if self.starstar_arg: self.starstar_arg.analyse_types(env) if not self.function.type.is_pyobject: + if self.function.type.is_error: + self.type = error_type + return error_type if hasattr(self.function, 'entry') and not self.function.entry.as_variable: error(self.pos, "Keyword arguments not allowed in cdef functions.") else: @@ -2592,6 +2595,7 @@ class GeneralCallNode(CallNode): self.is_temp = 1 def generate_result_code(self, code): + if self.type.is_error: return if self.keyword_args and self.starstar_arg: code.put_error_if_neg(self.pos, "PyDict_Update(%s, %s)" % ( diff --git a/tests/errors/callingnonexisting_T307.pyx b/tests/errors/callingnonexisting_T307.pyx new file mode 100644 index 00000000..b66f6464 --- /dev/null +++ b/tests/errors/callingnonexisting_T307.pyx @@ -0,0 +1,5 @@ +nonexisting(3, with_kw_arg=4) + +_ERRORS = u""" +1:11: undeclared name not builtin: nonexisting +""" -- 2.26.2