From aa51c51c8714f3a25d910d12a06ee54a654018cf Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 12 Jan 2008 14:45:03 +0100 Subject: [PATCH] raise compiler error for 'cdef readonly class' --- Cython/Compiler/Parsing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Cython/Compiler/Parsing.py b/Cython/Compiler/Parsing.py index 3872cab7..14af9c99 100644 --- a/Cython/Compiler/Parsing.py +++ b/Cython/Compiler/Parsing.py @@ -2026,9 +2026,11 @@ def p_c_class_definition(s, level, pos, error(pos, "Object struct name specification required for 'public' C class") if not typeobj_name: error(pos, "Type object name specification required for 'public' C class") - else: + elif visibility == 'private': if api: error(pos, "Only 'public' C class can be declared 'api'") + else: + error(pos, "Invalid class visibility '%s'" % visibility) return Nodes.CClassDefNode(pos, visibility = visibility, typedef_flag = typedef_flag, -- 2.26.2