assertion/rewrite: rewrite condition to be easier to follow

This commit is contained in:
Ran Benita 2020-09-12 22:22:29 +03:00
parent 634cde9506
commit 35350e11cd
1 changed files with 6 additions and 6 deletions

View File

@ -687,15 +687,15 @@ class AssertionRewriter(ast.NodeVisitor):
return
expect_docstring = False
elif (
not isinstance(item, ast.ImportFrom)
or item.level > 0
or item.module != "__future__"
isinstance(item, ast.ImportFrom)
and item.level == 0
and item.module == "__future__"
):
lineno = item.lineno
pass
else:
break
pos += 1
else:
lineno = item.lineno
lineno = item.lineno
imports = [
ast.Import([alias], lineno=lineno, col_offset=0) for alias in aliases
]