From bc3427caf480cd20e3435b60abea10e7fae87909 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Wed, 10 Oct 2007 03:19:20 -0700 Subject: [PATCH] Error message (rather than traceback) on missing name in cdef declarator --- Cython/Compiler/Nodes.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 80cffc31..8976cd7a 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -429,6 +429,9 @@ class CVarDefNode(StatNode): "Python object cannot be declared extern") name = name_declarator.name cname = name_declarator.cname + if name == '': + error(declarator.pos, "Missing name in declaration.") + return if type.is_cfunction: dest_scope.declare_cfunction(name, type, declarator.pos, cname = cname, visibility = self.visibility) -- 2.26.2