Skip to content

Commit

Permalink
Fix issue #1566: Fixed single location parsed line separator isn't used
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycrosley committed Mar 20, 2021
1 parent 0ee8733 commit 404d809
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion isort/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,13 @@ def _with_from_imports(
config=config,
multi_line_output=wrap.Modes.VERTICAL_GRID, # type: ignore
)
if max(len(x) for x in import_statement.split("\n")) > config.line_length:
if (
max(
len(import_line)
for import_line in import_statement.split(parsed.line_separator)
)
> config.line_length
):
import_statement = other_import_statement
if not do_multiline_reformat and len(import_statement) > config.line_length:
import_statement = wrap.line(import_statement, parsed.line_separator, config)
Expand Down

0 comments on commit 404d809

Please sign in to comment.