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