def visitModule(self, node):
stmt = node.node
+ found_docstring = False
for s in stmt.nodes:
+ # Skip over docstrings
+ if not found_docstring and isinstance(s, ast.Discard) \
+ and isinstance(s.expr, ast.Const) \
+ and isinstance(s.expr.value, str):
+ found_docstring = True
+ continue
if not self.check_stmt(s):
break
return
if node.modname != "__future__":
return
- raise SyntaxError, "invalid future statement"
+ raise SyntaxError, "invalid future statement " + repr(node)
def find_futures(node):
p1 = FutureParser()
Library
-------
+- The compiler package now supports future imports after the module docstring.
+
- Bug #1413790: zipfile now sanitizes absolute archive names that are
not allowed by the specs.