提交 6a946627 编辑于 作者: Timothy Crosley's avatar Timothy Crosley
浏览文件

Fix issue #807: no sections with future

显示 5 个添加1 个删除
+5 -1
......@@ -34,12 +34,16 @@ def sorted_imports(
if config.no_sections:
parsed.imports["no_sections"] = {"straight": [], "from": {}}
base_sections: Tuple[str, ...] = ()
for section in sections:
if section == "FUTURE":
base_sections = ("FUTURE",)
continue
parsed.imports["no_sections"]["straight"].extend(
parsed.imports[section].get("straight", [])
)
parsed.imports["no_sections"]["from"].update(parsed.imports[section].get("from", {}))
sections = ("no_sections",)
sections = base_sections + ("no_sections",)
output: List[str] = []
pending_lines_before = False
......
支持 Markdown
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册