From: Stefan Behnel Date: Wed, 9 Jul 2008 20:02:59 +0000 (+0200) Subject: from __future__ import braces X-Git-Tag: 0.9.8.1~128 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8be623ac525bacb5cae4f10a1abdfb5773afd9dd;p=cython.git from __future__ import braces --- 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)