Commit 8be623ac authored by Stefan Behnel's avatar Stefan Behnel

from __future__ import braces

parent a77c750e
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment