From: Stefan Behnel Date: Sat, 12 Jan 2008 13:45:03 +0000 (+0100) Subject: raise compiler error for 'cdef readonly class' X-Git-Tag: 0.9.6.14~29^2~62^2~13 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=aa51c51c8714f3a25d910d12a06ee54a654018cf;p=cython.git raise compiler error for 'cdef readonly class' --- 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,