assertion/rewrite: rewrite condition to be easier to follow
This commit is contained in:
parent
634cde9506
commit
35350e11cd
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue