from __future__ import braces
authorStefan Behnel <scoder@users.berlios.de>
Wed, 9 Jul 2008 20:02:59 +0000 (22:02 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Wed, 9 Jul 2008 20:02:59 +0000 (22:02 +0200)
Cython/Compiler/Parsing.py

index f63076a4846ef97c9eb1f7681e53b8629a871421..cda156d1f000834eb4a6391d6689f85a62904803 100644 (file)
@@ -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)