From 8be623ac525bacb5cae4f10a1abdfb5773afd9dd Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Wed, 9 Jul 2008 22:02:59 +0200 Subject: [PATCH] from __future__ import braces --- 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 f63076a4..cda156d1 100644 --- a/Cython/Compiler/Parsing.py +++ b/Cython/Compiler/Parsing.py @@ -974,10 +974,13 @@ def p_from_import_statement(s, first_statement = 0): s.error("from __future__ imports must occur at the beginning of the file") else: for (name_pos, name, as_name, kind) in imported_names: + if name == "braces": + s.error("not a chance", name_pos) + break try: directive = getattr(Future, name) except AttributeError: - s.error("future feature %s is not defined" % name) + s.error("future feature %s is not defined" % name, name_pos) break s.context.future_directives.add(directive) return Nodes.PassStatNode(pos) -- 2.26.2