More small fixes regarding docstrings.

This commit is contained in:
Dave Halter
2017-07-21 19:56:04 +02:00
parent 97b98a1da3
commit 9e5d6db24a
3 changed files with 11 additions and 3 deletions

View File

@@ -42,13 +42,14 @@ def _is_future_import_first(import_from):
"""
found_docstring = False
for stmt in _iter_stmts(import_from.get_root_node()):
if stmt.type == 'string' and not found_docstring:
continue
found_docstring = True
if stmt == import_from:
return True
if stmt.type == 'import_from' and _is_future_import(stmt):
continue
if stmt.type == 'string' and not found_docstring:
found_docstring = True
continue
return False