summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Crosley <timothy.crosley@gmail.com>2020-01-19 20:58:41 -0800
committerTimothy Crosley <timothy.crosley@gmail.com>2020-01-19 20:58:41 -0800
commit6a94662734c5e9df90ecd379f56cc021f858b57e (patch)
tree9fd8d659f2cfd18aef5a87ef6e553fe3eca96860
parentb3412e19e1b50f6ff4a9feb9758e388154cc8293 (diff)
downloadisort-feature/fix-issue-807.tar.gz
Fix issue #807: no sections with futurefeature/fix-issue-807
-rw-r--r--isort/output.py6
1 files changed, 5 insertions, 1 deletions
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