From d8952731e01c3d3e0118e745fbb96dc588f8d140 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Wed, 26 May 2010 16:18:32 +0200 Subject: [PATCH] move 'for from' syntax out of the way in Python file compilation --- Cython/Compiler/Parsing.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Cython/Compiler/Parsing.py b/Cython/Compiler/Parsing.py index 799480fa..c310a616 100644 --- a/Cython/Compiler/Parsing.py +++ b/Cython/Compiler/Parsing.py @@ -1216,7 +1216,7 @@ def p_for_bounds(s): s.next() iterator = p_for_iterator(s) return { 'target': target, 'iterator': iterator } - else: + elif not s.in_python_file: if s.sy == 'from': s.next() bound1 = p_bit_expr(s) @@ -1248,6 +1248,9 @@ def p_for_bounds(s): 'relation2': rel2, 'bound2': bound2, 'step': step } + else: + s.expect('in') + return {} def p_for_from_relation(s): if s.sy in inequality_relations: -- 2.26.2