raise compiler error for 'cdef readonly class'
authorStefan Behnel <scoder@users.berlios.de>
Sat, 12 Jan 2008 13:45:03 +0000 (14:45 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Sat, 12 Jan 2008 13:45:03 +0000 (14:45 +0100)
Cython/Compiler/Parsing.py

index 3872cab7623cb99e8f29f39364078a3c64bec285..14af9c99025da57144404974bb7ac218a5b711d9 100644 (file)
@@ -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,