do not leak C++ namespace into outer parser scope when parsing 'cdef extern' blocks
authorStefan Behnel <scoder@users.berlios.de>
Sat, 10 Apr 2010 13:09:49 +0000 (15:09 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Sat, 10 Apr 2010 13:09:49 +0000 (15:09 +0200)
Cython/Compiler/Parsing.py

index 35276bcd8e400978ee3c04cd02495c40209cc5ba..2f1f7b12960aad45fa7282ce803997e277b2dc76 100644 (file)
@@ -2186,10 +2186,10 @@ def p_cdef_extern_block(s, pos, ctx):
         s.next()
     else:
         _, include_file = p_string_literal(s)
+    ctx = ctx(cdef_flag = 1, visibility = 'extern')
     if s.systring == "namespace":
         s.next()
         ctx.namespace = p_string_literal(s)[1]
-    ctx = ctx(cdef_flag = 1, visibility = 'extern')
     if p_nogil(s):
         ctx.nogil = 1
     body = p_suite(s, ctx)