disable 'with template' syntax in Python files
authorStefan Behnel <scoder@users.berlios.de>
Wed, 3 Nov 2010 09:45:48 +0000 (10:45 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Wed, 3 Nov 2010 09:45:48 +0000 (10:45 +0100)
Cython/Compiler/Parsing.py

index 124129421a3521964a44b3197e1c760264ecec20..10cc16cddc244aa806257a302d9cec5c900278f8 100644 (file)
@@ -1504,7 +1504,7 @@ def p_include_statement(s, ctx):
 
 def p_with_statement(s):
     s.next() # 'with'
-    if s.systring == 'template':
+    if s.systring == 'template' and not s.in_python_file:
         node = p_with_template(s)
     else:
         node = p_with_items(s)