diff options
author | Timothy Crosley <timothy.crosley@gmail.com> | 2019-12-21 23:50:46 -0800 |
---|---|---|
committer | Timothy Crosley <timothy.crosley@gmail.com> | 2019-12-21 23:50:46 -0800 |
commit | 2381096a891fdbdc890c22b69ef40f203a49b01b (patch) | |
tree | c14a2f38b60cc164de7963c02da5207c63e5b213 | |
parent | 026b48ed0d6970f0893f8acd3627ac0e513dbacf (diff) | |
download | isort-2381096a891fdbdc890c22b69ef40f203a49b01b.tar.gz |
Contiguous import sorting working on isort codebase
-rw-r--r-- | isort/api.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/isort/api.py b/isort/api.py index 20f2ba5f..6921287f 100644 --- a/isort/api.py +++ b/isort/api.py @@ -180,7 +180,7 @@ def sort_imports( char_index += 1 not_imports = bool(in_quote) or in_top_comment - if not in_quote: + if not (in_quote or in_top_comment): stripped_line = line.strip() if not stripped_line or stripped_line.startswith("#"): import_section += line @@ -224,7 +224,6 @@ def sort_imports( not_imports = False if import_section: - import_section += line if not contains_imports: output_stream.write(import_section) else: @@ -233,5 +232,3 @@ def sort_imports( parse.file_contents(import_section, config=config), config, extension ) ) - contains_imports = False - import_section = "" |