Skip to content

Commit 404d809

Browse files
Fix issue #1566: Fixed single location parsed line separator isn't used
1 parent 0ee8733 commit 404d809

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

isort/output.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,13 @@ def _with_from_imports(
504504
config=config,
505505
multi_line_output=wrap.Modes.VERTICAL_GRID, # type: ignore
506506
)
507-
if max(len(x) for x in import_statement.split("\n")) > config.line_length:
507+
if (
508+
max(
509+
len(import_line)
510+
for import_line in import_statement.split(parsed.line_separator)
511+
)
512+
> config.line_length
513+
):
508514
import_statement = other_import_statement
509515
if not do_multiline_reformat and len(import_statement) > config.line_length:
510516
import_statement = wrap.line(import_statement, parsed.line_separator, config)

0 commit comments

Comments
 (0)