fix parser crash
authorStefan Behnel <stefan_ml@behnel.de>
Mon, 29 Oct 2012 22:46:21 +0000 (23:46 +0100)
committerStefan Behnel <stefan_ml@behnel.de>
Mon, 29 Oct 2012 22:46:21 +0000 (23:46 +0100)
Cython/Compiler/Parsing.py

index 52427e3..6e313dd 100644 (file)
@@ -2467,7 +2467,7 @@ def p_c_arg_decl(s, ctx, in_pyfunc, cmethod_flag = 0, nonempty = 0,
         annotation = p_test(s)
     if s.sy == '=':
         s.next()
-        if 'pxd' in s.level:
+        if 'pxd' in ctx.level:
             if s.sy not in ['*', '?']:
                 error(pos, "default values cannot be specified in pxd files, use ? or *")
             default = ExprNodes.BoolNode(1)