From 6a94662734c5e9df90ecd379f56cc021f858b57e Mon Sep 17 00:00:00 2001 From: Timothy Crosley <timothy.crosley@gmail.com> Date: Sun, 19 Jan 2020 20:58:41 -0800 Subject: [PATCH] Fix issue #807: no sections with future --- isort/output.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/isort/output.py b/isort/output.py index f7a4b2f7..035224c9 100644 --- a/isort/output.py +++ b/isort/output.py @@ -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 -- GitLab